Lines Matching refs:Blob
6 const { Blob } = require('buffer');
11 const b = new Blob();
16 assert.throws(() => new Blob(false), {
20 assert.throws(() => new Blob('hello'), {
24 assert.throws(() => new Blob({}), {
29 const b = new Blob([]);
45 assert.strictEqual(new Blob([], { type: 1 }).type, '1');
46 assert.strictEqual(new Blob([], { type: false }).type, 'false');
47 assert.strictEqual(new Blob([], { type: {} }).type, '[object object]');
51 const b = new Blob([Buffer.from('abc')]);
59 const b = new Blob([new ArrayBuffer(3)]);
67 const b = new Blob([new Uint8Array(3)]);
75 const b = new Blob([new Blob(['abc'])]);
83 const b = new Blob(['hello', Buffer.from('world')]);
91 const b = new Blob(['hello', new Uint8Array([0xed, 0xa0, 0x88])]);
100 const b = new Blob(
115 const b = new Blob(['hello', Buffer.from('world')]);
160 const b = new Blob([Buffer.from('hello'), Buffer.from('world')]);
175 const b = new Blob(['hello'], { type: '\x01' });
181 Object.getOwnPropertyDescriptor(Blob.prototype, Symbol.toStringTag);
185 value: 'Blob',
191 const descriptors = Object.getOwnPropertyDescriptors(Blob.prototype);
208 const b = new Blob(['test', 42]);
215 const b = new Blob();
217 'Blob { size: 0, type: \'\' }');
219 'Blob { size: 0, type: \'\' }');
220 assert.strictEqual(inspect(b, { depth: -1 }), '[Blob]');
224 // The Blob has to be over a specific size for the data to
226 const b = new Blob(['hello', 'there'.repeat(820)]);
232 const b = new Blob(['hello']);
242 const b = new Blob(['hello\n'], { endings: 'native' });
246 assert.throws(() => new Blob([], { endings }), {
253 assert.throws(() => Reflect.get(Blob.prototype, 'type', {}), {
256 assert.throws(() => Reflect.get(Blob.prototype, 'size', {}), {
259 assert.throws(() => Blob.prototype.slice(Blob.prototype, 0, 1), {
262 assert.throws(() => Blob.prototype.stream.call(), {
268 assert.rejects(async () => Blob.prototype.arrayBuffer.call(), {
271 assert.rejects(async () => Blob.prototype.text.call(), {
277 const blob = new Blob([
297 new Blob([], options).type,
298 new Blob([]).type,
310 assert.strictEqual(new Blob([], options).type, '3');
314 assert.throws(() => new Blob([], options), { code: 'ERR_INVALID_ARG_TYPE' });