Skip to content
Permalink
Browse files

feat: support Jest v26 (#1602)

Co-authored-by: Marek Urbanowicz <marek@urbanowicz.dev>
  • Loading branch information
ahnpnl and murbanowicz committed May 6, 2020
1 parent ffe96c4 commit 23b77419c066ed81d1c519ad9b267bd73681e955
Showing with 9,195 additions and 3,743 deletions.
  1. +3 −3 .travis.yml
  2. +1 −1 e2e/__external-repos__/custom-typings/package.json
  3. +1 −1 e2e/__external-repos__/simple-project-references/package.json
  4. +1 −1 e2e/__external-repos__/simple/with-dependency/package.json
  5. +1 −1 e2e/__external-repos__/yarn-workspace-composite/package.json
  6. +1 −1 e2e/__external-repos__/yarn-workspace-composite/packages/my-library/package.json
  7. +2 −2 e2e/__helpers__/test-case/utils.ts
  8. +1,380 −511 e2e/__templates__/default/package-lock.json
  9. +1 −1 e2e/__templates__/default/package.json
  10. +1,935 −848 e2e/__templates__/with-babel-7-string-config/package-lock.json
  11. +2 −2 e2e/__templates__/with-babel-7-string-config/package.json
  12. +1,935 −848 e2e/__templates__/with-babel-7/package-lock.json
  13. +2 −2 e2e/__templates__/with-babel-7/package.json
  14. +1,380 −511 e2e/__templates__/with-unsupported-version/package-lock.json
  15. +1 −1 e2e/__templates__/with-unsupported-version/package.json
  16. +1 −1 e2e/__tests__/__snapshots__/logger.test.ts.snap
  17. +2,459 −916 package-lock.json
  18. +8 −8 package.json
  19. +7 −7 scripts/e2e.js
  20. +2 −2 scripts/lib/bundle.js
  21. +3 −7 scripts/lib/npm.js
  22. +1 −1 scripts/lib/spawn-sync.js
  23. +1 −1 scripts/test-external-project.js
  24. +3 −3 scripts/update-e2e-templates.js
  25. +2 −2 src/__helpers__/mocks.ts
  26. +1 −1 src/__serializers__/processed-source.ts
  27. +2 −2 src/cli/cli.spec.ts
  28. +2 −2 src/cli/config/migrate.ts
  29. +2 −2 src/compiler/compiler-utils.ts
  30. +1 −1 src/compiler/instance.ts
  31. +4 −3 src/compiler/language-service.ts
  32. +7 −7 src/config/config-set.spec.ts
  33. +11 −11 src/config/config-set.ts
  34. +2 −2 src/transformers/hoist-jest.ts
  35. +6 −6 src/ts-jest-transformer.spec.ts
  36. +2 −2 src/ts-jest-transformer.ts
  37. +1 −1 src/util/backports.spec.ts
  38. +4 −4 src/util/importer.spec.ts
  39. +3 −3 src/util/importer.ts
  40. +1 −1 src/util/jsonable-value.spec.ts
  41. +1 −1 src/util/memoize.ts
  42. +1 −1 src/util/sha1.ts
  43. +7 −7 src/util/version-checkers.spec.ts
  44. +3 −3 src/util/version-checkers.ts
  45. +1 −1 tsconfig.json
@@ -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
@@ -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
@@ -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 :-/
@@ -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"
}
}
@@ -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"
}
}
@@ -41,7 +41,7 @@
"dependencies": {
"@types/jest": "^25.2.1",
"dependency": "file:../dependency",
"jest": "^25.4.0"
"jest": "^26.0.1"
},
"main": "./index.ts"
}
@@ -10,7 +10,7 @@
},
"devDependencies": {
"@types/jest": "^25.2.1",
"jest": "^25.4.0",
"jest": "^26.0.1",
"typescript": "~3.8.3"
}
}
@@ -2,4 +2,4 @@
"name": "@workspace-composite/my-library",
"version": "1.0.0",
"private": true
}
}
@@ -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...

0 comments on commit 23b7741

Please sign in to comment.
You can’t perform that action at this time.