Skip to content

Commit

Permalink
test: add mock for chrome.storage
Browse files Browse the repository at this point in the history
  • Loading branch information
helciofranco committed Dec 11, 2024
1 parent 645db52 commit d54cca0
Show file tree
Hide file tree
Showing 3 changed files with 155 additions and 162 deletions.
7 changes: 6 additions & 1 deletion packages/app/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ const config: JestConfigWithTsJest = {
require.resolve('@fuel-ui/test-utils/setup'),
'./jest.setup.ts',
],
setupFiles: ['fake-indexeddb/auto'],
setupFiles: [
// Mocking IndexedDB
'fake-indexeddb/auto',
// Mocking chrome.storage.local resources
'jest-webextension-mock',
],
extensionsToTreatAsEsm: ['.ts', '.tsx'],
injectGlobals: true,
moduleNameMapper: {
Expand Down
1 change: 1 addition & 0 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
"@types/react-helmet": "6.1.7",
"@vitejs/plugin-react": "4.1.0",
"@xstate/inspect": "0.8.0",
"jest-webextension-mock": "4.0.0",
"jszip": "3.10.1",
"msw": "1.3.2",
"msw-storybook-addon": "1.9.0",
Expand Down
Loading

0 comments on commit d54cca0

Please sign in to comment.