Skip to content

Commit 506df22

Browse files
authored
chore: use Jest 27 (#186)
1 parent c054549 commit 506df22

File tree

4 files changed

+567
-1440
lines changed

4 files changed

+567
-1440
lines changed

.github/workflows/nodejs.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
node-version: [10.x, 12.x, 13.x, 14.x, 16.x]
20-
jest-version: [24, 25, 26]
20+
jest-version: [24, 25, 26, 27]
21+
exclude:
22+
# jest@27 doesn't support node@13
23+
- node-version: 13.x
24+
jest-version: 27
2125
runs-on: ubuntu-latest
2226

2327
steps:
@@ -29,8 +33,8 @@ jobs:
2933
cache: yarn
3034
- name: install with jest v${{ matrix.jest-version }}
3135
run: |
32-
yarn
3336
yarn add --dev jest@${{ matrix.jest-version }} babel-jest@${{ matrix.jest-version }}
37+
yarn
3438
- name: run tests
3539
run: yarn test
3640
test-os:

__tests__/buildJsonResults.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ describe('buildJsonResults', () => {
278278

279279
// Mock Date.now() to return a fixed later value
280280
const startDate = new Date(multiProjectNoFailingTestsReport.startTime);
281-
spyOn(Date, 'now').and.returnValue(startDate.getTime() + 1234);
281+
jest.spyOn(Date, 'now').mockImplementation(() => startDate.getTime() + 1234);
282282

283283
jsonResults = buildJsonResults(multiProjectNoFailingTestsReport, '/',
284284
Object.assign({}, constants.DEFAULT_OPTIONS, {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"xml": "^1.0.1"
2525
},
2626
"devDependencies": {
27-
"jest": "26.0.1",
27+
"jest": "^27.2.3",
2828
"libxmljs": "^0.19.7",
2929
"slash": "^3.0.0"
3030
}

0 commit comments

Comments
 (0)