-
-
Notifications
You must be signed in to change notification settings - Fork 399
/
cli-custom-logo.spec.ts
41 lines (33 loc) · 1.32 KB
/
cli-custom-logo.spec.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
import * as chai from 'chai';
import {temporaryDir, shell, pkg, exists, exec, read, shellAsync, stats} from '../helpers';
const expect = chai.expect,
tmp = temporaryDir();
interface Image {
size: number;
}
describe('CLI custom logo', () => {
const distFolder = tmp.name + '-logo';
describe('when specifying a custom logo', () => {
before(function (done) {
tmp.create(distFolder);
let ls = shell('node', [
'./bin/index-cli.js',
'-p', './test/src/todomvc-ng2/src/tsconfig.json',
'-d', distFolder,
'--customLogo', './test/src/todomvc-ng2/logo.png']);
if (ls.stderr.toString() !== '') {
console.error(`shell error: ${ls.stderr.toString()}`);
done('error');
}
done();
});
after(() => tmp.clean(distFolder));
it('should have copied the customLogo', () => {
let isFileExists = exists(`${distFolder}/images/logo.png`);
expect(isFileExists).to.be.true;
let originalFileSize = (stats('test/src/todomvc-ng2/logo.png') as Image).size,
copiedFileSize = (stats(`${distFolder}/images/logo.png`) as Image).size;
expect(originalFileSize).to.equal(copiedFileSize);
});
});
});