forked from vscode-icons/vscode-icons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.test.ts
43 lines (37 loc) · 1.33 KB
/
build.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// tslint:disable only-arrow-functions
// tslint:disable no-unused-expression
import { expect } from 'chai';
import * as sinon from 'sinon';
import * as proxyq from 'proxyquire';
import { schema } from '../src/models/iconsManifest/defaultSchema';
describe('Build: tests', function () {
context('ensures that', function () {
let sandbox: sinon.SinonSandbox;
let iconsGeneratorStub: sinon.SinonStub;
let generateIconsManifestStub: sinon.SinonStub;
let persistStub: sinon.SinonStub;
beforeEach(function () {
sandbox = sinon.createSandbox();
generateIconsManifestStub = sandbox.stub().returns(schema);
persistStub = sandbox.stub();
iconsGeneratorStub = sandbox.stub().callsFake(() => ({
generateIconsManifest: generateIconsManifestStub,
persist: persistStub,
}));
});
afterEach(function () {
sandbox.restore();
});
context(`the 'build' script`, function () {
it(`generates and saves the default icons manifest`, function () {
proxyq('../src/build', {
'./iconsManifest/iconsGenerator': {
IconsGenerator: iconsGeneratorStub,
},
});
expect(generateIconsManifestStub.calledOnceWithExactly()).to.be.true;
expect(persistStub.calledOnceWithExactly(schema, true)).to.be.true;
});
});
});
});