Skip to content

Commit

Permalink
Merge pull request #359 from bcgov/feature/react-component-test-frame…
Browse files Browse the repository at this point in the history
…work

Jest test framework for React components
  • Loading branch information
ty2k authored May 28, 2024
2 parents df5d78b + cb7713a commit 605c388
Show file tree
Hide file tree
Showing 4 changed files with 11,034 additions and 6,687 deletions.
23 changes: 23 additions & 0 deletions packages/react-components/jest.config.ts
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;
Loading

0 comments on commit 605c388

Please sign in to comment.