-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9536033
commit eedf790
Showing
4 changed files
with
2,883 additions
and
200 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,19 @@ | ||
const flowRemoveTypes = require("flow-remove-types"); | ||
const createTransformer = require("@swc/jest").createTransformer; | ||
const createSwcTransformer = require("@swc/jest").createTransformer; | ||
|
||
const swcTransformer = createSwcTransformer(); | ||
|
||
module.exports = { | ||
process(src, filename, jestOptions) { | ||
const flowRemoved = flowRemoveTypes(src, jestOptions).toString(); | ||
const result = createTransformer().process( | ||
flowRemoved, | ||
filename, | ||
jestOptions | ||
); | ||
return result; | ||
return swcTransformer.process(flowRemoved, filename, jestOptions); | ||
}, | ||
processAsync(src, filename, jestOptions) { | ||
const flowRemoved = flowRemoveTypes(src).toString(); | ||
return createTransformer().processAsync(flowRemoved, filename, jestOptions); | ||
return swcTransformer.processAsync(flowRemoved, filename, jestOptions); | ||
}, | ||
getCacheKey(src, filename, jestOptions) { | ||
const flowRemoved = flowRemoveTypes(src).toString(); | ||
return createTransformer().getCacheKey(flowRemoved, filename, jestOptions); | ||
return swcTransformer.getCacheKey(flowRemoved, filename, jestOptions); | ||
}, | ||
}; |
Oops, something went wrong.