Skip to content

Commit 1447168

Browse files
committed
ci: provide test reports
1 parent 5ddc35c commit 1447168

File tree

7 files changed

+47
-15
lines changed

7 files changed

+47
-15
lines changed

.circleci/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ commands:
3636
- run:
3737
name: Test
3838
command: yarn test-ci
39+
environment:
40+
JEST_JUNIT_OUTPUT_DIR: "reports/junit/js-test-results.xml"
3941
save-cache:
4042
steps:
4143
- save_cache:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ lib/
1111
package.json.lerna_backup
1212
/*.iml
1313
tsconfig.tsbuildinfo
14+
jest.config.js

babel.config.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

jest.config.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

jest.config.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import {Config} from '@jest/types';
2+
import {TsJestGlobalOptions} from 'ts-jest/dist/types';
3+
4+
interface JestConfig extends Partial<Config.InitialOptions> {
5+
globals?: Config.ConfigGlobals & {'ts-jest': TsJestGlobalOptions};
6+
}
7+
8+
const jestConfig: JestConfig = {
9+
preset: 'ts-jest',
10+
reporters: ['default', 'jest-junit'],
11+
testEnvironment: 'node',
12+
testRegex: undefined,
13+
testMatch: [
14+
'**/*.test.ts?(x)',
15+
'**/@commitlint/{lint,read,travis-cli,cli,load,prompt}/src/**/*.test.js?(x)',
16+
'**/@commitlint/prompt-cli/*.test.js?(x)'
17+
]
18+
};
19+
20+
module.exports = jestConfig;

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
"publish": "lerna publish --conventional-commits",
1717
"reinstall": "yarn clean && yarn install",
1818
"start": "lerna run start --stream --parallel --include-filtered-dependencies",
19+
"pretest": "tsc jest.config.ts",
1920
"test": "jest && lerna run test --stream --parallel --include-filtered-dependencies",
20-
"test-ci": "jest --runInBand && lerna run test --stream --parallel --include-filtered-dependencies"
21+
"test-ci": "jest --ci --runInBand --reporters=default --reporters=jest-junit && lerna run test --stream --parallel --include-filtered-dependencies"
2122
},
2223
"commitlint": {
2324
"extends": [
@@ -88,6 +89,7 @@
8889
"docsify-cli": "4.3.0",
8990
"husky": "3.0.9",
9091
"jest": "24.8.0",
92+
"jest-junit": "^10.0.0",
9193
"lerna": "3.18.3",
9294
"lint-staged": "8.2.1",
9395
"prettier": "1.17.1",

yarn.lock

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6004,6 +6004,17 @@ jest-jasmine2@^24.9.0:
60046004
pretty-format "^24.9.0"
60056005
throat "^4.0.0"
60066006

6007+
jest-junit@^10.0.0:
6008+
version "10.0.0"
6009+
resolved "https://registry.npmjs.org/jest-junit/-/jest-junit-10.0.0.tgz#c94b91c24920a327c9d2a075e897b2dba4af494b"
6010+
integrity sha512-dbOVRyxHprdSpwSAR9/YshLwmnwf+RSl5hf0kCGlhAcEeZY9aRqo4oNmaT0tLC16Zy9D0zekDjWkjHGjXlglaQ==
6011+
dependencies:
6012+
jest-validate "^24.9.0"
6013+
mkdirp "^0.5.1"
6014+
strip-ansi "^5.2.0"
6015+
uuid "^3.3.3"
6016+
xml "^1.0.1"
6017+
60076018
jest-leak-detector@^24.9.0:
60086019
version "24.9.0"
60096020
resolved "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-24.9.0.tgz#b665dea7c77100c5c4f7dfcb153b65cf07dcf96a"
@@ -10003,6 +10014,11 @@ uuid@^3.0.1, uuid@^3.3.2:
1000310014
resolved "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866"
1000410015
integrity sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==
1000510016

10017+
uuid@^3.3.3:
10018+
version "3.4.0"
10019+
resolved "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"
10020+
integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==
10021+
1000610022
validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.3:
1000710023
version "3.0.4"
1000810024
resolved "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a"
@@ -10274,6 +10290,11 @@ xml-name-validator@^3.0.0:
1027410290
resolved "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a"
1027510291
integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==
1027610292

10293+
xml@^1.0.1:
10294+
version "1.0.1"
10295+
resolved "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5"
10296+
integrity sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=
10297+
1027710298
xtend@^4.0.0, xtend@~4.0.1:
1027810299
version "4.0.2"
1027910300
resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54"

0 commit comments

Comments
 (0)