Skip to content

Commit

Permalink
chore: use Jest 27 (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Sep 29, 2021
1 parent c054549 commit 506df22
Show file tree
Hide file tree
Showing 4 changed files with 567 additions and 1,440 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/nodejs.yml
Expand Up @@ -17,7 +17,11 @@ jobs:
fail-fast: false
matrix:
node-version: [10.x, 12.x, 13.x, 14.x, 16.x]
jest-version: [24, 25, 26]
jest-version: [24, 25, 26, 27]
exclude:
# jest@27 doesn't support node@13
- node-version: 13.x
jest-version: 27
runs-on: ubuntu-latest

steps:
Expand All @@ -29,8 +33,8 @@ jobs:
cache: yarn
- name: install with jest v${{ matrix.jest-version }}
run: |
yarn
yarn add --dev jest@${{ matrix.jest-version }} babel-jest@${{ matrix.jest-version }}
yarn
- name: run tests
run: yarn test
test-os:
Expand Down
2 changes: 1 addition & 1 deletion __tests__/buildJsonResults.test.js
Expand Up @@ -278,7 +278,7 @@ describe('buildJsonResults', () => {

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

jsonResults = buildJsonResults(multiProjectNoFailingTestsReport, '/',
Object.assign({}, constants.DEFAULT_OPTIONS, {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -24,7 +24,7 @@
"xml": "^1.0.1"
},
"devDependencies": {
"jest": "26.0.1",
"jest": "^27.2.3",
"libxmljs": "^0.19.7",
"slash": "^3.0.0"
}
Expand Down

0 comments on commit 506df22

Please sign in to comment.