From df9144b49322c705e925b81e0947887f9bb69ec5 Mon Sep 17 00:00:00 2001 From: Faisal Salman Date: Sat, 6 May 2023 19:53:51 +0700 Subject: [PATCH] Modify test scripts --- package.json | 8 ++++++-- script/test-all.sh | 13 +++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 1d0c8e0..9913e2e 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/script/test-all.sh b/script/test-all.sh index b77df1a..b47652b 100755 --- a/script/test-all.sh +++ b/script/test-all.sh @@ -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 \ No newline at end of file +npm run test:lockfile-lint || exit 1 \ No newline at end of file