From 25793a579efc7883b40748211188f7638d2e90d5 Mon Sep 17 00:00:00 2001 From: Barrie Treloar Date: Wed, 17 Jul 2019 15:21:27 +0930 Subject: [PATCH] chore(mocha): use test/mocha.opts file to specify babel loading Avoids the need to run babel-node directly. Allows calling `mocha test/rules/` directly. --- package.json | 2 +- test/mocha.opts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 test/mocha.opts diff --git a/package.json b/package.json index 6872e05..0cbc5ef 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ ], "scripts": { "build": "npm run lint && npm run test && rm -rf dist && babel src --out-dir dist", - "test": "babel-node node_modules/.bin/isparta cover --report text-summary --report lcov node_modules/mocha/bin/_mocha -- --recursive", + "test": "node node_modules/isparta/bin/isparta cover --report text-summary --report lcov node_modules/mocha/bin/_mocha -- --recursive", "lint": "eslint src/ test/", "ci": "npm run build && cat coverage/lcov.info | node_modules/.bin/coveralls", "patch": "release patch", diff --git a/test/mocha.opts b/test/mocha.opts new file mode 100644 index 0000000..52fdec4 --- /dev/null +++ b/test/mocha.opts @@ -0,0 +1 @@ + --compilers js:babel-register \ No newline at end of file