-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(misc): replace
ts-jest
transformer with @swc/jest
for ts sol…
…ution setup (#29763) ## Current Behavior ## Expected Behavior ## Related Issue(s) Fixes #
- Loading branch information
1 parent
5127c15
commit 626c514
Showing
14 changed files
with
479 additions
and
42 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
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
30 changes: 30 additions & 0 deletions
30
packages/detox/src/generators/application/files/ts-solution/jest.config.ts.template
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,30 @@ | ||
/* eslint-disable */ | ||
<% if (js) { %>const { readFileSync } = require('fs')<% } else { %>import { readFileSync } from 'fs';<% } %> | ||
|
||
// Reading the SWC compilation config for the spec files | ||
const swcJestConfig = JSON.parse( | ||
readFileSync(`${__dirname}/.spec.swcrc`, 'utf-8') | ||
); | ||
|
||
// Disable .swcrc look-up by SWC core because we're passing in swcJestConfig ourselves | ||
swcJestConfig.swcrc = false; | ||
|
||
<% if (js) { %>module.exports =<% } else { %>export default<% } %> { | ||
preset: "<%= offsetFromRoot %>jest.preset", | ||
rootDir: ".", | ||
testMatch: [ | ||
"<rootDir>/src/**/*.test.ts?(x)", | ||
"<rootDir>/src/**/*.spec.ts?(x)" | ||
], | ||
testTimeout: 120000, | ||
maxWorkers: 1, | ||
globalSetup: "detox/runners/jest/globalSetup", | ||
globalTeardown: "detox/runners/jest/globalTeardown", | ||
reporters: ["detox/runners/jest/reporter"], | ||
testEnvironment: "detox/runners/jest/testEnvironment", | ||
verbose: true, | ||
setupFilesAfterEnv: ["<rootDir>/test-setup.ts"], | ||
transform: { | ||
"^.+\\.(ts|js|html)$": ['@swc/jest', swcJestConfig] | ||
} | ||
}; |
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
Oops, something went wrong.