-
Notifications
You must be signed in to change notification settings - Fork 406
/
Copy pathcli-enable.test.js
45 lines (43 loc) · 1.14 KB
/
cli-enable.test.js
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
const getUniqueProjectPath = require('./utils/getUniqueProjectPath');
const spawnCmd = require('./utils/spawnCmd');
const tap = require('tap');
const { readFileSync } = require('fs');
const wrapAsync = require('../bin/utils').wrapAsync;
const projectRoot = getUniqueProjectPath();
tap.test('Enable ->', (t) =>
wrapAsync(function* () {
yield spawnCmd([
'init',
'--verbose',
'--project-dir',
projectRoot,
'--edition',
'@pattern-lab/edition-node',
'--starterkit',
'@pattern-lab/starterkit-handlebars-vanilla',
]);
yield spawnCmd([
'install',
'--plugins',
'@pattern-lab/plugin-tab',
'--config',
`${projectRoot}/patternlab-config.json`,
]);
yield spawnCmd([
'enable',
'--plugins',
'@pattern-lab/plugin-tab',
'--config',
`${projectRoot}/patternlab-config.json`,
]);
const config = JSON.parse(
readFileSync(`${projectRoot}/patternlab-config.json`, 'utf8')
);
t.equal(
config.plugins['@pattern-lab/plugin-tab'].enabled,
true,
'and set the enabled flag in patternlab-config.json'
);
t.end();
})
);