1
0
Fork 0

Add smoke test for create-freesewing-pattern.

This commit is contained in:
Nick Dower 2022-02-18 20:32:12 +01:00
parent f555f15750
commit 647e566dc0
3 changed files with 22 additions and 2 deletions

View file

@ -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": {

View 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();
}
})
})