From 56d97d251dea0d0cc7690c90653ecfed06471257 Mon Sep 17 00:00:00 2001 From: ZiJian Liu Date: Mon, 3 May 2021 16:51:43 +0800 Subject: [PATCH] test: increase coverage for Blob Refs: https://coverage.nodejs.org/coverage-68e6673224365120/lib/internal/blob.js.html#L132 PR-URL: https://github.com/nodejs/node/pull/38515 Reviewed-By: Colin Ihrig Reviewed-By: Rich Trott Reviewed-By: James M Snell Reviewed-By: Darshan Sen --- test/parallel/test-blob.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/parallel/test-blob.js b/test/parallel/test-blob.js index 0ae0384001a8b0..b034ed99f82f5e 100644 --- a/test/parallel/test-blob.js +++ b/test/parallel/test-blob.js @@ -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'); { @@ -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]'); +}