Skip to content

Commit 4d8b8b7

Browse files
authored
Merge pull request glayzzle#463 from czosel/refactor-tests
chore: refactor testing infrastructure
2 parents 4e9d584 + 62f0ad5 commit 4d8b8b7

19 files changed

+1106
-2106
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = {
55
sourceType: "module"
66
},
77
plugins: ["prettier"],
8-
extends: ["eslint:recommended"],
8+
extends: ["eslint:recommended", "plugin:jest/recommended"],
99
env: {
1010
browser: true,
1111
node: true,

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ notifications:
1717
on_success: change
1818
on_failure: always
1919
on_start: never
20-
script: npm run lint && npm run cover
20+
script: npm test
2121
after_success: cat /home/travis/build/glayzzle/php-parser/coverage/lcov.info | /home/travis/build/glayzzle/php-parser/node_modules/coveralls/bin/coveralls.js
2222
after_script:
2323
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT

jest.config.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
"use strict";
2+
3+
const ENABLE_COVERAGE = !!process.env.CI || !!process.env.COVERAGE;
4+
5+
module.exports = {
6+
collectCoverage: ENABLE_COVERAGE,
7+
coverageDirectory: "coverage/",
8+
projects: [
9+
{
10+
displayName: "test",
11+
testEnvironment: "node"
12+
},
13+
{
14+
runner: "jest-runner-eslint",
15+
displayName: "lint",
16+
testMatch: ["<rootDir>/**/*.js"],
17+
testPathIgnorePatterns: ["<rootDir>/node_modules/", "<rootDir>/coverage/"]
18+
}
19+
]
20+
};

0 commit comments

Comments
 (0)