Add smoke test for create-freesewing-pattern.
This commit is contained in:
parent
f555f15750
commit
647e566dc0
3 changed files with 22 additions and 2 deletions
|
@ -22,6 +22,8 @@ create-freesewing-pattern:
|
||||||
modulebuild: '!'
|
modulebuild: '!'
|
||||||
cibuild_step1: '!'
|
cibuild_step1: '!'
|
||||||
build: '!'
|
build: '!'
|
||||||
|
test: 'BABEL_ENV=production ../../node_modules/.bin/_mocha tests/*.test.mjs'
|
||||||
|
testci: 'BABEL_ENV=production ../../node_modules/.bin/_mocha tests/*.test.mjs'
|
||||||
css-theme:
|
css-theme:
|
||||||
cibuild_step1: 'npx node-sass --output-style compressed src/theme.scss dist/theme.css'
|
cibuild_step1: 'npx node-sass --output-style compressed src/theme.scss dist/theme.css'
|
||||||
build: 'npx node-sass --output-style compressed src/theme.scss dist/theme.css'
|
build: 'npx node-sass --output-style compressed src/theme.scss dist/theme.css'
|
||||||
|
|
|
@ -21,11 +21,12 @@
|
||||||
],
|
],
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"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",
|
"pubtest": "npm publish --registry http://localhost:6662",
|
||||||
"pubforce": "npm publish",
|
"pubforce": "npm publish",
|
||||||
"symlink": "mkdir -p ./node_modules/@freesewing && cd ./node_modules/@freesewing && ln -s -f ../../../* . && cd -",
|
"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": {},
|
"peerDependencies": {},
|
||||||
"dependencies": {
|
"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