@equisoft/jest-utils 1.5.3-snapshot.20240902195031 → 1.5.3-snapshot.20240905210316
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/config/createJestConfig.js +5 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -53,3 +53,8 @@ const config = {
|
|
|
53
53
|
|
|
54
54
|
module.exports = createJestConfig(config);
|
|
55
55
|
```
|
|
56
|
+
|
|
57
|
+
## Extra configuration for GitHub Actions
|
|
58
|
+
Jest has a built-in support for GitHub Actions annotations (see [Jest documentation](https://jestjs.io/docs/configuration#github-actions-reporter)).
|
|
59
|
+
This feature is enabled by default when running on GitHub Actions.
|
|
60
|
+
To disable this feature, you can set the `JEST_ENABLE_ANNOTATIONS` environment variable to `false` when running Jest.
|
|
@@ -23,6 +23,9 @@ function mergeDeep(...objects) {
|
|
|
23
23
|
return prev;
|
|
24
24
|
}, {});
|
|
25
25
|
}
|
|
26
|
+
function isReporter(value) {
|
|
27
|
+
return !!value;
|
|
28
|
+
}
|
|
26
29
|
function createJestConfig(config) {
|
|
27
30
|
return Object.assign({}, mergeDeep({
|
|
28
31
|
clearMocks: true,
|
|
@@ -43,6 +46,7 @@ function createJestConfig(config) {
|
|
|
43
46
|
extensionsToTreatAsEsm: ['.jsx', '.ts', '.tsx'],
|
|
44
47
|
reporters: [
|
|
45
48
|
'default',
|
|
49
|
+
process.env.CI === 'true' && process.env.JEST_ENABLE_ANNOTATIONS !== 'false' && 'github-actions',
|
|
46
50
|
[
|
|
47
51
|
'jest-junit',
|
|
48
52
|
{
|
|
@@ -53,7 +57,7 @@ function createJestConfig(config) {
|
|
|
53
57
|
titleTemplate: '{title}',
|
|
54
58
|
},
|
|
55
59
|
],
|
|
56
|
-
],
|
|
60
|
+
].filter(isReporter),
|
|
57
61
|
resetMocks: true,
|
|
58
62
|
snapshotSerializers: [require.resolve('@equisoft/jest-utils/serializer')],
|
|
59
63
|
testEnvironment: 'jsdom',
|