From 414ca11ec94aa9f1f1700155cc6a17982fddbb7b Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Mon, 23 Sep 2019 20:54:11 +0900 Subject: [PATCH] Fix tests on CI --- .circleci/config.yml | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1294557..342842d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -63,6 +63,13 @@ jobs: - checkout - setup_npm - run: npm run lint + - run: + # NOTE: Karma loads ts-node automatically and treats karma.conf.js as a TypeScript. + # Karma does not starts by karma.conf.js transpile failure, and this hack removes + # ts-node module from the local before test. + # See: https://github.com/karma-runner/karma/issues/3329 + name: Remove node-ts from node_modules + command: mv node_modules/ts-node node_modules/ts-node.orig - run: npm test - run: npm run package diff --git a/package.json b/package.json index 4496ce5..45e5b88 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "lint": "eslint --ext .js,.jsx,.ts,.tsx src", "type-checks": "tsc --noEmit", "test": "karma start", - "test:e2e": "mocha --timeout 10000 --retries 5 e2e" + "test:e2e": "mocha --timeout 10000 --retries 5 --require ts-node/register --extension ts e2e" }, "repository": { "type": "git",