Merge pull request #1899 from freesewing/nickd/create-freesewing-pattern-test
Add smoke test for create-freesewing-pattern.
This commit is contained in:
commit
18e3b7d713
3 changed files with 22 additions and 2 deletions
|
@ -21,11 +21,12 @@
|
|||
],
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"create-freesewing-pattern: No tests configured. Perhaps you'd like to do this?\" && exit 0",
|
||||
"test": "BABEL_ENV=production ../../node_modules/.bin/_mocha tests/*.test.mjs",
|
||||
"pubtest": "npm publish --registry http://localhost:6662",
|
||||
"pubforce": "npm publish",
|
||||
"symlink": "mkdir -p ./node_modules/@freesewing && cd ./node_modules/@freesewing && ln -s -f ../../../* . && cd -",
|
||||
"start": "rollup -c -w"
|
||||
"start": "rollup -c -w",
|
||||
"testci": "BABEL_ENV=production ../../node_modules/.bin/_mocha tests/*.test.mjs"
|
||||
},
|
||||
"peerDependencies": {},
|
||||
"dependencies": {
|
||||
|
|
17
packages/create-freesewing-pattern/tests/cli.test.mjs
Normal file
17
packages/create-freesewing-pattern/tests/cli.test.mjs
Normal file
|
@ -0,0 +1,17 @@
|
|||
import chai from 'chai'
|
||||
import { spawnSync } from 'child_process'
|
||||
|
||||
describe('CLI help', () => {
|
||||
it("Should run successfully", () => {
|
||||
const result = spawnSync('node', ['./lib/cli.js', '-h'])
|
||||
if (result.status != 0) {
|
||||
console.log('Command failed: node ./lib/cli.js -h');
|
||||
console.log('status: ' + result.status);
|
||||
console.log('stdout:')
|
||||
console.log(result.stdout.toString('utf8'));
|
||||
console.log('stderr:')
|
||||
console.log(result.stderr.toString('utf8'));
|
||||
chai.assert.fail();
|
||||
}
|
||||
})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue