Skip to content
Prev Previous commit
test: increase coverage for Blob
Refs: https://coverage.nodejs.org/coverage-68e6673224365120/lib/internal/blob.js.html#L132

PR-URL: #38515
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
  • Loading branch information
Lxxyx authored and targos committed Aug 13, 2021
commit 9a9f207d77a3e507f561cd3734cda0587adbbf2f
8 changes: 8 additions & 0 deletions test/parallel/test-blob.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const common = require('../common');
const assert = require('assert');
const { Blob } = require('buffer');
const { inspect } = require('util');
const { MessageChannel } = require('worker_threads');

{
Expand Down Expand Up @@ -191,3 +192,10 @@ assert.throws(() => new Blob({}), {
assert.strictEqual(text, 'test42');
}));
}

{
const b = new Blob();
assert.strictEqual(inspect(b, { depth: null }),
'Blob { size: 0, type: \'\' }');
assert.strictEqual(inspect(b, { depth: -1 }), '[Blob]');
}