Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support Jest 27 #676

Merged
merged 1 commit into from
Dec 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [10.x, 12.x, 14.x]
node-version: [12.x, 14.x]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}

Expand Down
4 changes: 2 additions & 2 deletions e2e/test-app-v10-zone-v11/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "jest --no-cache",
"test": "jest --clearCache && jest",
"lint": "ng lint"
},
"private": true,
Expand All @@ -31,7 +31,7 @@
"@types/jquery": "^3.5.4",
"@types/node": "^12.19.3",
"codelyzer": "^6.0.1",
"jest": "^26.6.2",
"jest": "^27.0.0-next.2",
"ts-node": "~9.0.0",
"tslint": "~6.1.3",
"typescript": "~4.0.5"
Expand Down
1,051 changes: 570 additions & 481 deletions e2e/test-app-v10-zone-v11/yarn.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions e2e/test-app-v10/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "jest --no-cache",
"test": "jest --clearCache && jest",
"lint": "ng lint"
},
"private": true,
Expand All @@ -29,7 +29,7 @@
"@types/jest": "^26.0.15",
"@types/node": "^12.19.3",
"codelyzer": "^6.0.1",
"jest": "^26.6.2",
"jest": "^27.0.0-next.2",
"ng-packagr": "^10.1.0",
"ts-node": "~9.0.0",
"tslint": "~6.1.3",
Expand Down
1,011 changes: 565 additions & 446 deletions e2e/test-app-v10/yarn.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions e2e/test-app-v9/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "jest --no-cache",
"test": "jest --clearCache && jest",
"lint": "ng lint"
},
"private": true,
Expand All @@ -30,7 +30,7 @@
"@angular/language-service": "~9.1.12",
"@types/jest": "^26.0.15",
"@types/node": "^12.19.3",
"jest": "^26.6.2",
"jest": "^27.0.0-next.2",
"ts-node": "^9.0.0",
"typescript": "~3.8.3"
}
Expand Down
22 changes: 14 additions & 8 deletions e2e/test-app-v9/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,20 @@ describe('AppComponent', () => {
}, 100);
});

it('async with done should work', async done => {
let flag = false;
setTimeout(() => {
flag = true;
expect(flag).toBe(true);
done();
}, 100);
});
/*
* This test doesn't work with jest-circus `testRunner`. If you want to test async with done callback, please use
* testRunner `jest-jasmine2`.
*
* More information see discussion https://github.com/facebook/jest/issues/10529
*/
// it('async with done should not work with jest-circus', async done => {
// let flag = false;
// setTimeout(() => {
// flag = true;
// expect(flag).toBe(true);
// done();
// }, 100);
// });

it.each([[1, 2]])('it.each', (arg1, arg2) => {
expect(arg1).toBe(1);
Expand Down