-
Notifications
You must be signed in to change notification settings - Fork 40
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 #359 from bcgov/feature/react-component-test-frame…
…work Jest test framework for React components
- Loading branch information
Showing
4 changed files
with
11,034 additions
and
6,687 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import type { Config } from "jest"; | ||
|
||
const config: Config = { | ||
// Limit search for tests to the `components` directory | ||
roots: ["./src/components"], | ||
|
||
// Start with the presets from the `ts-jest` package | ||
preset: "ts-jest", | ||
|
||
// Use `jsdom` as the test environment because we are testing React components | ||
testEnvironment: "jsdom", | ||
|
||
// Mocks for static file imports | ||
moduleNameMapper: { | ||
// Necessary because of our CSS file imports like `import "./Button.css"` | ||
"\\.(css)$": "identity-obj-proxy", | ||
}, | ||
|
||
// Log each test result instead of a summary | ||
verbose: true, | ||
}; | ||
|
||
export default config; |
Oops, something went wrong.