Skip to content
Merged
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-testing-library": "^6.2.2",
"espree": "^10.0.1",
"fake-indexeddb": "^4.0.2",
"fake-indexeddb": "^5.0.2",
"fetch-mock-jest": "^1.5.1",
"file-loader": "^6.2.0",
"flow-bin": "^0.96.0",
Expand Down
4 changes: 4 additions & 0 deletions src/test/fixtures/mocks/indexeddb.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ function resetIndexedDb() {
}

export function autoMockIndexedDB() {
// fake-indexeddb no longer includes a structuredClone polyfill, so we need to
// import it explicitly.
require('core-js/stable/structured-clone');

// This require has a side-effect that's not possible to have with a function
// call, and that we want to happen only when calling autoMockIndexedDB.
// That's why we require it instead of importing.
Expand Down
3 changes: 3 additions & 0 deletions src/test/store/symbolication.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ import { formatTree, formatStack } from '../fixtures/utils';
import { assertSetContainsOnly } from '../fixtures/custom-assertions';
import { ensureExists } from 'firefox-profiler/utils/flow';

// fake-indexeddb no longer includes a structuredClone polyfill, so we need to
// import it explicitly.
import 'core-js/stable/structured-clone';
import { indexedDB, IDBKeyRange } from 'fake-indexeddb';
import { stripIndent } from 'common-tags';
import { SymbolsNotFoundError } from '../../profile-logic/errors';
Expand Down
3 changes: 3 additions & 0 deletions src/test/unit/symbol-store-db.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

import SymbolStoreDB from '../../profile-logic/symbol-store-db';
import { completeSymbolTableAsTuple } from '../fixtures/example-symbol-table';
// fake-indexeddb no longer includes a structuredClone polyfill, so we need to
// import it explicitly.
import 'core-js/stable/structured-clone';
import { indexedDB, IDBKeyRange } from 'fake-indexeddb';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use autoMockIndexedDB here and in the tests below instead of defining the polyfill manually?


describe('SymbolStoreDB', function () {
Expand Down
3 changes: 3 additions & 0 deletions src/test/unit/symbol-store.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import { SymbolStore } from '../../profile-logic/symbol-store';
import { SymbolsNotFoundError } from '../../profile-logic/errors';
import { completeSymbolTableAsTuple } from '../fixtures/example-symbol-table';
// fake-indexeddb no longer includes a structuredClone polyfill, so we need to
// import it explicitly.
import 'core-js/stable/structured-clone';
import { indexedDB, IDBKeyRange } from 'fake-indexeddb';
import { FakeSymbolStore } from '../fixtures/fake-symbol-store';
import { ensureExists } from '../../utils/flow';
Expand Down
Loading