Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
- name: Check CONTRIBUTING versions
run: npm run check:contributing-versions

- name: Run unit tests
run: npm test

- name: Build
run: npm run build

Expand Down
2 changes: 1 addition & 1 deletion .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
// Lint & Prettify TS and JS files - only the staged files
"**/*.(ts|tsx|js|jsx)": (filenames) => [
`cross-env NODE_ENV=test npx eslint --fix --max-warnings=0 ${filenames.map((f) => `'${f.replace(/'/g, "'\\''")}'`).join(" ")}`,
`cross-env NODE_ENV=test npx eslint --fix --max-warnings=0 --no-warn-ignored ${filenames.map((f) => `'${f.replace(/'/g, "'\\''")}'`).join(" ")}`,
`npx prettier --write ${filenames.map((f) => `'${f.replace(/'/g, "'\\''")}'`).join(" ")}`,
],

Expand Down
16 changes: 16 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
testEnvironment: "jsdom",
// Target the running node version so babel-preset-gatsby does not inject
// browser core-js polyfills, which the site does not install.
transform: {
"\\.[jt]sx?$": [
"babel-jest",
{ presets: [["babel-preset-gatsby", { targets: { node: "current" } }]] },
],
},
// Only pick up the maintained suites under __tests__ directories. The legacy
// enzyme `*.test.js` files next to components target React 16 and are not run.
testMatch: ["**/__tests__/**/*.test.js"],
collectCoverageFrom: ["src/utils/**/*.js"],
coveragePathIgnorePatterns: ["/node_modules/"],
};
Loading
Loading