Skip to content

Commit

Permalink
feat: support Jest v26 (#1602)
Browse files Browse the repository at this point in the history
Co-authored-by: Marek Urbanowicz <marek@urbanowicz.dev>
  • Loading branch information
ahnpnl and murbanowicz authored May 6, 2020
1 parent ffe96c4 commit 23b7741
Show file tree
Hide file tree
Showing 45 changed files with 9,195 additions and 3,743 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ language: node_js
jobs:
include:
- os: windows
node_js: 8
node_js: 10
env: TS_JEST_E2E_WORKDIR=\%APPDATA%\ts-jest-e2e-workdir TS_JEST_E2E_OPTIMIZATIONS=1
cache:
npm: true
Expand All @@ -14,7 +14,7 @@ jobs:
- npm run clean -- --when-ci-commit-message
- npm run test:unit -- --runInBand
- os: windows
node_js: 12
node_js: 14
env: TS_JEST_E2E_WORKDIR=\%APPDATA%\ts-jest-e2e-workdir TS_JEST_E2E_OPTIMIZATIONS=1
cache:
npm: true
Expand All @@ -27,7 +27,7 @@ jobs:
- npm run clean -- --when-ci-commit-message
- npm run test:external-repos
- os: linux
node_js: 10
node_js: 12
env: TS_JEST_E2E_WORKDIR=/tmp/ts-jest-e2e-workdir TS_JEST_E2E_OPTIMIZATIONS=1
before_install:
# Disabled, randomly works :-/
Expand Down
2 changes: 1 addition & 1 deletion e2e/__external-repos__/custom-typings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"devDependencies": {
"@types/jest": "^25.2.1",
"@types/jquery": "^3.3.35",
"jest": "^25.4.0",
"jest": "^26.0.1",
"typescript": "^3.8.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"devDependencies": {
"@types/jest": "^25.2.1",
"@types/lodash": "^4.14.116",
"jest": "^25.4.0",
"jest": "^26.0.1",
"typescript": "^3.8.3"
}
}
2 changes: 1 addition & 1 deletion e2e/__external-repos__/simple/with-dependency/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"dependencies": {
"@types/jest": "^25.2.1",
"dependency": "file:../dependency",
"jest": "^25.4.0"
"jest": "^26.0.1"
},
"main": "./index.ts"
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"devDependencies": {
"@types/jest": "^25.2.1",
"jest": "^25.4.0",
"jest": "^26.0.1",
"typescript": "~3.8.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"name": "@workspace-composite/my-library",
"version": "1.0.0",
"private": true
}
}
4 changes: 2 additions & 2 deletions e2e/__helpers__/test-case/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ export function normalizeJestOutput(output: string): string {
let out: string = output
.trim()
// removes total and estimated times
.replace(/^(\s*Time\s*:\s*)[\d.]+m?s(?:(,\s*estimated\s+)[\d.]+m?s)?$/gm, (_, start) => `${start}XXs`)
.replace(/^(\s*Time\s*:\s*)[\d.]+ m?s(?:(,\s*estimated\s+)[\d.]+ m?s)?$/gm, (_, start) => `${start}XXs`)
// remove times after PASS/FAIL path/to/file (xxxs)
.replace(/^\s*((?:PASS|FAIL) .+) \([\d.]+m?s\)$/gm, (_, start) => `${start}`)
// removes each test time values
.replace(
// eslint-disable-next-line no-useless-escape
/^(\s*)(✕|×|✓|√)(\s+[^\(]+)(\s+\([\d.]+m?s\))?$/gm,
/^(\s*)(✕|×|✓|√)(\s+[^\(]+)(\s+\([\d.]+ m?s\))?$/gm,
(_, start, mark, mid /* , time */) => `${start}${normalizeTestMark(mark)}${mid}`,
)
// TODO: improves this...
Expand Down
Loading

0 comments on commit 23b7741

Please sign in to comment.