-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: split Jest configuration for Client and Electron
The Jest configuration and setup files have been split into separate ones for client and Electron app testing. This will allow distinct test configuration and match patterns for the two different environments. Furthermore, corresponding changes are made in the package.json file to add different test scripts for running these new configuration files.
- Loading branch information
Showing
4 changed files
with
41 additions
and
13 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { defaults } from "jest-config"; | ||
|
||
// Adjust the import path to your tsconfig.json file | ||
|
||
const jestConfig = { | ||
...defaults, | ||
roots: ["<rootDir>/src/electron"], | ||
testMatch: ["**/?(*.)test.ts"], | ||
testPathIgnorePatterns: [".e2e."], | ||
transform: { | ||
"^.+\\.ts$": ["@swc/jest"], | ||
}, | ||
moduleNameMapper: { | ||
"@/(.*)": "<rootDir>/src/electron/future/$1", | ||
"#/(.*)": "<rootDir>/src/shared/$1", | ||
}, | ||
collectCoverage: true, | ||
coverageDirectory: "./coverage", | ||
coverageProvider: "v8", | ||
coverageReporters: ["lcov", "text", "json"], | ||
coverageThreshold: { | ||
global: { | ||
lines: 80, | ||
}, | ||
}, | ||
transformIgnorePatterns: ["/node_modules/"], | ||
extensionsToTreatAsEsm: [".ts"], | ||
setupFilesAfterEnv: ["<rootDir>/jest.setup.electron.ts"], | ||
}; | ||
|
||
export default jestConfig; |
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