Skip to content

Commit

Permalink
Fix JS tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
dd32 committed Jul 1, 2024
1 parent 45bc6da commit 93da2b4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
3 changes: 3 additions & 0 deletions settings/babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env", ["@babel/preset-react", {"runtime": "automatic"}] ]
}
10 changes: 10 additions & 0 deletions settings/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/** @type {import('jest').Config} */
const config = {
testEnvironment: "jsdom",

Check failure on line 3 in settings/jest.config.js

View workflow job for this annotation

GitHub Actions / All

Replace `··testEnvironment:·"jsdom"` with `↹testEnvironment:·'jsdom'`
moduleNameMapper: {

Check failure on line 4 in settings/jest.config.js

View workflow job for this annotation

GitHub Actions / All

Replace `··` with `↹`
'^uuid$': require.resolve('uuid')

Check failure on line 5 in settings/jest.config.js

View workflow job for this annotation

GitHub Actions / All

Replace `····'^uuid$':·require.resolve('uuid')` with `↹↹'^uuid$':·require.resolve(·'uuid'·),`
},

Check failure on line 6 in settings/jest.config.js

View workflow job for this annotation

GitHub Actions / All

Replace `··` with `↹`
setupFilesAfterEnv: ['./jest.setup.js']

Check failure on line 7 in settings/jest.config.js

View workflow job for this annotation

GitHub Actions / All

Replace `··setupFilesAfterEnv:·['./jest.setup.js']` with `↹setupFilesAfterEnv:·[·'./jest.setup.js'·],`
};

module.exports = config;
13 changes: 13 additions & 0 deletions settings/jest.setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Object.defineProperty(window, 'matchMedia', {

Check failure on line 1 in settings/jest.setup.js

View workflow job for this annotation

GitHub Actions / All

Insert `·`
writable: true,

Check failure on line 2 in settings/jest.setup.js

View workflow job for this annotation

GitHub Actions / All

Replace `··` with `↹`
value: jest.fn().mockImplementation(query => ({

Check failure on line 3 in settings/jest.setup.js

View workflow job for this annotation

GitHub Actions / All

Replace `··value:·jest.fn().mockImplementation(query·=>·(` with `↹value:·jest.fn().mockImplementation(·(·query·)·=>·(·`

Check failure on line 3 in settings/jest.setup.js

View workflow job for this annotation

GitHub Actions / All

'jest' is not defined
matches: false,

Check failure on line 4 in settings/jest.setup.js

View workflow job for this annotation

GitHub Actions / All

Replace `····` with `↹↹`
media: query,
onchange: null,
addListener: jest.fn(), // deprecated
removeListener: jest.fn(), // deprecated
addEventListener: jest.fn(),
removeEventListener: jest.fn(),
dispatchEvent: jest.fn()
}))
})

0 comments on commit 93da2b4

Please sign in to comment.