forked from pattern-lab/patternlab-node-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli-init.test.js
More file actions
18 lines (16 loc) · 976 Bytes
/
cli-init.test.js
File metadata and controls
18 lines (16 loc) · 976 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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 ->', t => wrapAsync(function*() {
yield spawnCmd(['init', '--verbose', '--project-dir', projectRoot, '--edition', 'edition-node', '--starterkit', '@pattern-lab/starterkit-mustache-base']);
t.ok(exists.sync(path.resolve(projectRoot)), 'should initialize a PatternLab project');
t.ok(exists.sync(path.resolve(projectRoot, 'source')), 'with a source dir');
t.ok(exists.sync(path.resolve(projectRoot, 'public')), 'with a public dir');
t.ok(exists.sync(path.resolve(projectRoot, 'pattern_exports')), 'with a pattern_exports dir');
t.ok(exists.sync(path.resolve(projectRoot, 'patternlab-config.json')), 'with a pattern_exports dir');
t.end();
}));