From 40f2aa8444a8a6eb132babe771eaf062e6d4dcd2 Mon Sep 17 00:00:00 2001 From: 18alantom <2.alan.tom@gmail.com> Date: Tue, 1 Nov 2022 12:51:48 +0530 Subject: [PATCH] refactor: move test to sh script - this allows passing globs as args --- package.json | 2 +- scripts/test.sh | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100755 scripts/test.sh diff --git a/package.json b/package.json index ef5dbd11..a199dbad 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "electron:serve": "vue-cli-service electron:serve", "script:translate": "scripts/runner.sh scripts/generateTranslations.ts", "script:profile": "scripts/profile.sh", - "test": "scripts/runner.sh ./node_modules/.bin/tape ./**/tests/**/*.spec.ts | tap-spec" + "test": "scripts/test.sh" }, "dependencies": { "@popperjs/core": "^2.10.2", diff --git a/scripts/test.sh b/scripts/test.sh new file mode 100755 index 00000000..a0774fda --- /dev/null +++ b/scripts/test.sh @@ -0,0 +1,8 @@ +TEST_PATH=$@ + +if [ $# -eq 0 ] + then + TEST_PATH=./**/tests/**/*.spec.ts +fi + +./scripts/runner.sh ./node_modules/.bin/tape $TEST_PATH | ./node_modules/.bin/tap-spec \ No newline at end of file