-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* use jest projects * poc * tweak ordering * Add changeset * Nit * remove extra export * update changeset * Tweak changeset * Update src/api/jest/index.ts Co-authored-by: Ryan Ling <ryan@outlook.com.au> --------- Co-authored-by: Ryan Ling <ryan@outlook.com.au>
- Loading branch information
Showing
6 changed files
with
131 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
'skuba': minor | ||
--- | ||
|
||
Jest.mergePreset: Propagate root-level configuration options to `projects` | ||
|
||
[`Jest.mergePreset`](https://seek-oss.github.io/skuba/docs/development-api/jest.html#mergepreset) now propagates the `moduleNameMapper` and `transform` options from root-level configuration to the `projects` array. | ||
|
||
If you were referencing the base config in the `projects` array: | ||
|
||
```ts | ||
const baseConfig = Jest.mergePreset({ | ||
// ... | ||
}); | ||
|
||
export default { | ||
...baseConfig, | ||
projects: [ | ||
{ | ||
...baseConfig, | ||
displayName: 'unit', | ||
setupFiles: ['<rootDir>/jest.setup.ts'], | ||
testPathIgnorePatterns: ['\\.int\\.test\\.ts'], | ||
}, | ||
{ | ||
...baseConfig, | ||
displayName: 'integration', | ||
setupFiles: ['<rootDir>/jest.setup.ts'], | ||
testMatch: ['**/*.int.test.ts'], | ||
}, | ||
], | ||
}; | ||
``` | ||
|
||
You can replace it with the following: | ||
|
||
```ts | ||
export default Jest.mergePreset({ | ||
// ... | ||
projects: [ | ||
{ | ||
displayName: 'unit', | ||
setupFiles: ['<rootDir>/jest.setup.ts'], | ||
testPathIgnorePatterns: ['\\.int\\.test\\.ts'], | ||
}, | ||
{ | ||
displayName: 'integration', | ||
setupFiles: ['<rootDir>/jest.setup.ts'], | ||
testMatch: ['**/*.int.test.ts'], | ||
}, | ||
], | ||
}); | ||
``` | ||
|
||
The `projects` option allows you to reuse a single Jest config file for different test types. View the [Jest documentation](https://jestjs.io/docs/configuration#projects-arraystring--projectconfig) for more information. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters