/var/www/cobraambalaj/node_modules/@nodelib/fs.walk/out/providers
NameSizeModeActions
async.d.ts5130644editdlrm
async.d.ts.map5780644editdlrm
async.js9360644editdlrm
async.spec.d.ts520644editdlrm
async.spec.d.ts.map1270644editdlrm
async.spec.js17890644editdlrm
index.d.ts2060644editdlrm
index.d.ts.map2590644editdlrm
index.js3970644editdlrm
stream.d.ts4560644editdlrm
stream.d.ts.map4800644editdlrm
stream.js10550644editdlrm
stream.spec.d.ts530644editdlrm
stream.spec.d.ts.map1290644editdlrm
stream.spec.js26510644editdlrm
sync.d.ts3720644editdlrm
sync.d.ts.map4320644editdlrm
sync.js4210644editdlrm
sync.spec.d.ts510644editdlrm
sync.spec.d.ts.map1250644editdlrm
sync.spec.js10170644editdlrm
Edit: /var/www/cobraambalaj/node_modules/@nodelib/fs.walk/out/providers/stream.spec.js (2651B)
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const assert = require("assert"); const stream_1 = require("stream"); const sinon = require("sinon"); const settings_1 = require("../settings"); const tests = require("../tests"); const stream_2 = require("./stream"); class TestProvider extends stream_2.default { constructor(_root, _settings = new settings_1.default()) { super(_root, _settings); this._reader = new tests.TestAsyncReader(); this._stream.emit = sinon.stub(); this._stream.push = sinon.stub(); } get reader() { return this._reader; } get stream() { return this._stream; } } describe('Providers → Stream', () => { describe('.read', () => { it('should return stream', () => { const provider = new TestProvider('directory'); const stream = provider.read(); assert.ok(stream instanceof stream_1.Readable); }); it('should call reader function with correct set of arguments', () => { const provider = new TestProvider('directory'); provider.read(); assert.ok(provider.reader.read.called); }); it('should re-emit the "error" event from reader', () => { const provider = new TestProvider('directory'); provider.reader.onError.yields(tests.EPERM_ERRNO); provider.read(); assert.deepStrictEqual(provider.stream.emit.args, [['error', tests.EPERM_ERRNO]]); }); it('should call the "push" method with entry value for the "entry" event from reader', () => { const provider = new TestProvider('directory'); const fakeEntry = tests.buildFakeFileEntry(); provider.reader.onEntry.yields(fakeEntry); provider.read(); assert.deepStrictEqual(provider.stream.push.args, [[fakeEntry]]); }); it('should call the "push" method with "null" value for the "end" event from reader', () => { const provider = new TestProvider('directory'); provider.reader.onEnd.yields(); provider.read(); assert.deepStrictEqual(provider.stream.push.args, [[null]]); }); it('should do not destroy reader when it is already destroyed', () => { const provider = new TestProvider('directory'); const stream = provider.read(); stream.destroy(); assert.ok(stream.destroyed); assert.doesNotThrow(() => stream.destroy()); }); }); });