-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(js): generate correct jest config for --compiler=swc --js
- Loading branch information
1 parent
c63364f
commit 6584993
Showing
4 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
packages/js/src/generators/library/__snapshots__/library.spec.ts.snap
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,22 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`lib --unit-test-runner jest should generate test configuration with swc 1`] = ` | ||
"/* eslint-disable */ | ||
const { readFileSync } = require('fs') | ||
// Reading the SWC compilation config and remove the \\"exclude\\" | ||
// for the test files to be compiled by SWC | ||
const { exclude: _, ...swcJestConfig } = JSON.parse( | ||
readFileSync(\`\${__dirname}/.lib.swcrc\`, 'utf-8') | ||
); | ||
module.exports = { | ||
displayName: 'my-lib', | ||
preset: '../../jest.preset.js', | ||
transform: { | ||
'^.+\\\\\\\\.[tj]s$': ['@swc/jest', swcJestConfig], | ||
}, | ||
moduleFileExtensions: ['ts', 'js', 'html'], | ||
coverageDirectory: '../../coverage/libs/my-lib' | ||
}; | ||
" | ||
`; |
2 changes: 1 addition & 1 deletion
2
packages/js/src/generators/library/files/jest-config/jest.config.__ext__
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