forked from pattern-lab/patternlab-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli-build.test.js
More file actions
49 lines (47 loc) · 1.27 KB
/
cli-build.test.js
File metadata and controls
49 lines (47 loc) · 1.27 KB
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
44
45
46
47
48
49
const exists = require('path-exists');
const getUniqueProjectPath = require('./utils/getUniqueProjectPath');
const path = require('path');
const spawnCmd = require('./utils/spawnCmd');
const tap = require('tap');
const wrapAsync = require('../bin/utils').wrapAsync;
const projectRoot = getUniqueProjectPath();
tap.test('Init and build ->', t =>
wrapAsync(function*() {
yield spawnCmd([
'init',
'--verbose',
'--project-dir',
projectRoot,
'--edition',
'@pattern-lab/edition-node',
'--starterkit',
'@pattern-lab/starterkit-mustache-demo',
]);
yield spawnCmd([
'build',
'--config',
`${projectRoot}/patternlab-config.json`,
]);
t.ok(
exists.sync(path.resolve(projectRoot, 'public')),
'should build all files into public dir'
);
t.ok(
exists.sync(path.resolve(projectRoot, 'public', 'annotations')),
'with an annotations dir'
);
t.ok(
exists.sync(path.resolve(projectRoot, 'public', 'css')),
'with a css dir'
);
t.ok(
exists.sync(path.resolve(projectRoot, 'public', 'images')),
'with a images dir'
);
t.ok(
exists.sync(path.resolve(projectRoot, 'public', 'styleguide')),
'with a styleguide dir'
);
t.end();
})
);