From 4edc0f4fffc9721390a6f449a0aa48ee4341c4b9 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Tue, 31 Mar 2020 08:28:24 +0200 Subject: [PATCH] fix: refactored Jest test execution on CI (#93) * fix: jest run all tests in the same run Closes #46 * feat: cleanup * fix: t * fix: coverage --- {tests => e2e}/example.html | 0 {tests => e2e}/stub.test.ts | 0 jest.config.e2e.js | 6 ++++++ jest.config.js | 2 +- package.json | 4 +++- 5 files changed, 10 insertions(+), 2 deletions(-) rename {tests => e2e}/example.html (100%) rename {tests => e2e}/stub.test.ts (100%) create mode 100644 jest.config.e2e.js diff --git a/tests/example.html b/e2e/example.html similarity index 100% rename from tests/example.html rename to e2e/example.html diff --git a/tests/stub.test.ts b/e2e/stub.test.ts similarity index 100% rename from tests/stub.test.ts rename to e2e/stub.test.ts diff --git a/jest.config.e2e.js b/jest.config.e2e.js new file mode 100644 index 00000000..914ecaa5 --- /dev/null +++ b/jest.config.e2e.js @@ -0,0 +1,6 @@ +module.exports = { + preset: 'ts-jest', + testEnvironment: './lib/PlaywrightEnvironment.js', + testPathIgnorePatterns: ['/node_modules/', 'lib'], + testMatch: ['**/e2e/**/*.test.ts'], +} diff --git a/jest.config.js b/jest.config.js index 189f0908..e4215908 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,6 +1,6 @@ module.exports = { preset: 'ts-jest', - testEnvironment: './lib/PlaywrightEnvironment.js', testPathIgnorePatterns: ['/node_modules/', 'lib'], + testMatch: ['**/src/**/*.test.ts'], collectCoverage: true, } diff --git a/package.json b/package.json index ea96002e..0534ff66 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,9 @@ "format": "prettier --write \"*.{js,md}\" \"src/**/*.js\"", "lint": "tsc --noEmit && eslint . --ext .js,.ts", "prepublishOnly": "npm run build", - "test": "jest src/bin/utils.test.ts tests/stub.test.ts && jest src/utils.test.ts", + "test": "npm run test:src && npm run test:e2e", + "test:src": "jest", + "test:e2e": "jest -c jest.config.e2e.js", "coveralls": "jest --coverage && cat ./coverage/lcov.info | coveralls" }, "husky": {