This repository has been archived on 2021-05-23. You can view files and clone it, but cannot push or open issues or pull requests.
simpledash/bulma/node_modules/@nodelib/fs.walk/out/providers/sync.spec.js

28 lines
1017 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const assert = require("assert");
const settings_1 = require("../settings");
const tests = require("../tests");
const sync_1 = require("./sync");
class TestProvider extends sync_1.default {
constructor(_root, _settings = new settings_1.default()) {
super(_root, _settings);
this._reader = new tests.TestSyncReader();
}
get reader() {
return this._reader;
}
}
describe('Providers → Sync', () => {
describe('.read', () => {
it('should call reader function with correct set of arguments and got result', () => {
const provider = new TestProvider('directory');
const fakeEntry = tests.buildFakeFileEntry();
provider.reader.read.returns([fakeEntry]);
const actual = provider.read();
assert.deepStrictEqual(actual, [fakeEntry]);
assert.ok(provider.reader.read.called);
});
});
});