Skip to content

Commit fe68fac

Browse files
committed
spec_test_runner.ts: fix indexing spec tests
1 parent 5fc5fc8 commit fe68fac

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

packages/firestore/test/unit/specs/spec_test_runner.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ import {
178178
QueryEvent,
179179
SharedWriteTracker
180180
} from './spec_test_components';
181+
import {
182+
IndexedDbIndexManager,
183+
indexedDbIndexManagerInstallFieldIndexPlugin
184+
} from '../../../src/local/indexeddb_index_manager';
181185

182186
use(chaiExclude);
183187

@@ -991,6 +995,16 @@ abstract class TestRunner {
991995
expect(this.started).to.equal(!expectedState.isShutdown);
992996
}
993997
if ('indexes' in expectedState) {
998+
if (!(this.localStore.indexManager instanceof IndexedDbIndexManager)) {
999+
throw new Error(
1000+
'localStore.indexManager should be ' +
1001+
'an instance of IndexedDbIndexManager'
1002+
);
1003+
}
1004+
indexedDbIndexManagerInstallFieldIndexPlugin(
1005+
this.localStore.indexManager
1006+
);
1007+
9941008
const fieldIndexes: FieldIndex[] =
9951009
await this.persistence.runTransaction(
9961010
'getFieldIndexes ',

0 commit comments

Comments
 (0)