-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #434 from tsedio/fix-generated-test-command
Fix generated test command
- Loading branch information
Showing
8 changed files
with
90 additions
and
66 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
55 changes: 0 additions & 55 deletions
55
packages/cli-plugin-jest/templates/init/jest.config.js.hbs
This file was deleted.
Oops, something went wrong.
71 changes: 71 additions & 0 deletions
71
packages/cli-plugin-jest/templates/init/jest.config.mjs.hbs
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,71 @@ | ||
// For a detailed explanation regarding each configuration property, visit: | ||
// https://jestjs.io/docs/en/configuration.html | ||
|
||
/** @type {import('jest').Config} */ | ||
export default { | ||
// Automatically clear mock calls and instances between every test | ||
clearMocks: true, | ||
|
||
// Indicates whether the coverage information should be collected while executing the test | ||
collectCoverage: true, | ||
|
||
// An array of glob patterns indicating a set of files for which coverage information should be collected | ||
// collectCoverageFrom: undefined, | ||
|
||
// The directory where Jest should output its coverage files | ||
coverageDirectory: "coverage", | ||
|
||
// An array of regexp pattern strings used to skip coverage collection | ||
coveragePathIgnorePatterns: ["index.ts", "/node_modules/"], | ||
|
||
// An object that configures minimum threshold enforcement for coverage results | ||
coverageThreshold: { | ||
global: { | ||
branches: 70, | ||
functions: 70, | ||
lines: 70, | ||
statements: 70 | ||
} | ||
}, | ||
|
||
// An array of file extensions your modules use | ||
moduleFileExtensions: ["js", "json", "jsx", "ts", "tsx", "node"], | ||
extensionsToTreatAsEsm: [".ts", ".tsx"], | ||
// The test environment that will be used for testing | ||
testEnvironment: "node", | ||
|
||
// The glob patterns Jest uses to detect test files | ||
testMatch: ["**/src/**/__tests__/**/*.[jt]s?(x)", "**/src/**/?(*.)+(spec|test).[tj]s?(x)"], | ||
// A map from regular expressions to paths to transformers | ||
transform: { | ||
"^.+\\.(j|t)sx?$": [ | ||
"@swc/jest", | ||
{ | ||
jsc: { | ||
parser: { | ||
syntax: "typescript", | ||
tsx: true, | ||
decorators: true, | ||
dynamicImport: true, | ||
importMeta: true, | ||
preserveAllComments: true | ||
}, | ||
target: "esnext", | ||
transform: { | ||
useDefineForClassFields: false, | ||
legacyDecorator: true, | ||
decoratorMetadata: true | ||
} | ||
}, | ||
module: { | ||
type: "es6" | ||
} | ||
} | ||
] | ||
}, | ||
moduleNameMapper: { | ||
"^(\\.{1,2}/.*)\\.js$": "$1" | ||
}, | ||
testPathIgnorePatterns: ["/node_modules/", "/dist/"], | ||
transformIgnorePatterns: ["/node_modules/(?!(module-name|another-module)/)"] | ||
}; |
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