Skip to content

Commit 5fe4776

Browse files
authored
Introduce a Jest task (microsoft#391)
* Introduce a jest task * Use ~ instead ^ in package.json * Update shrinkwrap file * Update api.ts files * Update documentations in JestTask and make config parameters optional * Add Jest to test-web-library-build (WIP) * Convert api-documenter to use jest instead of mocha * Convert tests in test-web-library-build to use jest * Add the workaround for converting jest output from stderr to stdout. * Add change file for the Jest task * Ping types log4js to avoid broken types karma packages. * Fix preCopyTest in test-web-library-build to use ES5 * Add isEnabled to jest.json and let it control whether tests run in jest or mocha/karma. And add more defaults to JestTask. * Set collectCoverageFrom to get complete coverage. * Update other api.ts files * Update shrinkwrap file * Rename isJestEnabled to _isJestEnabled * Remove runInBand and maxWorkers from jest config. * Add change files * Copy snapshots from src to lib before Jest test and from lib to src if updating snapshots. * Add a missing change file
1 parent da6bda6 commit 5fe4776

File tree

32 files changed

+1303
-190
lines changed

32 files changed

+1303
-190
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "",
5+
"packageName": "@microsoft/api-documenter",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@microsoft/api-documenter",
10+
"email": "qz2017@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/gulp-core-build-karma",
5+
"comment": "Turn off Karma task when Jest task is enabled",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "@microsoft/gulp-core-build-karma",
10+
"email": "qz2017@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/gulp-core-build-mocha",
5+
"comment": "Turn off Mocha task when Jest task is enabled",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "@microsoft/gulp-core-build-mocha",
10+
"email": "qz2017@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/gulp-core-build",
5+
"comment": "Add a Jest task to support running tests on Jest",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "@microsoft/gulp-core-build",
10+
"email": "qz2017@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/node-library-build",
5+
"comment": "Support Jest task",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "@microsoft/node-library-build",
10+
"email": "qz2017@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/web-library-build",
5+
"comment": "Support Jest task",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "@microsoft/web-library-build",
10+
"email": "qz2017@users.noreply.github.com"
11+
}

common/config/rush/nonbrowser-approved-packages.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,14 @@
233233
"name": "istanbul-instrumenter-loader",
234234
"allowedCategories": [ "libraries" ]
235235
},
236+
{
237+
"name": "jest",
238+
"allowedCategories": [ "libraries", "other" ]
239+
},
240+
{
241+
"name": "jest-cli",
242+
"allowedCategories": [ "libraries", "other" ]
243+
},
236244
{
237245
"name": "jju",
238246
"allowedCategories": [ "libraries" ]

0 commit comments

Comments
 (0)