Skip to content

Commit

Permalink
Create blob-impl.js UT
Browse files Browse the repository at this point in the history
  • Loading branch information
ArpanSolanki29 committed Apr 22, 2024
1 parent f3a801a commit 2937685
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/blob-impl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"use strict";
const assert = require("node:assert/strict");
const { describe, it } = require("mocha-sugar-free");

const BlobImpl = require("../lib/jsdom/living/file-api/Blob-impl.js");
const TextDecoder = require("util").TextDecoder;

Check failure on line 6 in test/blob-impl.js

View workflow job for this annotation

GitHub Actions / Lint

Use object destructuring
global.TextDecoder = TextDecoder;

describe("File-API: Blob-impl.js", () => {
it("should return correct test from the blob", (done) => {

Check failure on line 10 in test/blob-impl.js

View workflow job for this annotation

GitHub Actions / Lint

Unexpected parentheses around single function argument
const globalObject = {};
const blobData = "Hello World";
const blobPros = { type: "text/plain" };
const blob = new BlobImpl(globalObject, [[blobData], blobPros], {});

blob
.text()
.then((text) => {

Check failure on line 18 in test/blob-impl.js

View workflow job for this annotation

GitHub Actions / Lint

Unexpected parentheses around single function argument
assert.strictEqual(text, blobData, 'Blob text should be "Hello World"');
done();
})
.catch(done);
});
});

0 comments on commit 2937685

Please sign in to comment.