Modify test scripts

This commit is contained in:
Faisal Salman 2023-05-06 19:53:51 +07:00
parent a519d2b879
commit df9144b493
2 changed files with 15 additions and 6 deletions

View File

@ -165,8 +165,12 @@
],
"scripts": {
"build": "./script/build-dist.sh && ./script/build-module.js",
"fuzz": "npx jazzer ./test/jazzer-fuzz-test.js --sync",
"test": "npm run build && ./script/test-all.sh"
"fuzz": "jazzer ./test/jazzer-fuzz-test.js --sync",
"test": "./script/test-all.sh",
"test:jshint": "jshint src && jshint script",
"test:lockfile-lint": "npx lockfile-lint -p package-lock.json",
"test:mocha": "mocha -R list test/mocha*js",
"test:playwright": "playwright test"
},
"devDependencies": {
"@babel/parser": "7.15.8",

View File

@ -1,21 +1,26 @@
#!/usr/bin/env bash
echo '
- run build
'
npm run build || exit 1
echo '
- lint js code
'
jshint src && jshint script || exit 1
npm run test:jshint || exit 1
echo '
- test using mocha
'
mocha -R list test/mocha*js || exit 1
npm run test:mocha || exit 1
echo '
- test using playwright
'
npx playwright test || exit 1
npm run test:playwright || exit 1
echo '
- lint lockfile
'
npx lockfile-lint -p package-lock.json || exit 1
npm run test:lockfile-lint || exit 1