File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,8 @@ export interface Target {
38
38
readonly endAt : Bound | null ;
39
39
}
40
40
41
- class TargetImpl implements Target {
41
+ // Visible for testing
42
+ export class TargetImpl implements Target {
42
43
memoizedCanonicalId : string | null = null ;
43
44
constructor (
44
45
readonly path : ResourcePath ,
Original file line number Diff line number Diff line change @@ -34,7 +34,12 @@ import {
34
34
import { Timestamp } from '../../../src/api/timestamp' ;
35
35
import * as persistenceHelpers from './persistence_test_helpers' ;
36
36
import { TestTargetCache } from './test_target_cache' ;
37
- import { canonifyTarget , Target , targetEquals } from '../../../src/core/target' ;
37
+ import {
38
+ canonifyTarget ,
39
+ Target ,
40
+ targetEquals ,
41
+ TargetImpl
42
+ } from '../../../src/core/target' ;
38
43
39
44
describe ( 'MemoryTargetCache' , ( ) => {
40
45
genericTargetCacheTests ( persistenceHelpers . testMemoryEagerPersistence ) ;
@@ -106,7 +111,7 @@ describe('IndexedDbTargetCache', () => {
106
111
function genericTargetCacheTests (
107
112
persistencePromise : ( ) => Promise < Persistence >
108
113
) : void {
109
- addEqualityMatcher ( { equalsFn : targetEquals , forType : Target } ) ;
114
+ addEqualityMatcher ( { equalsFn : targetEquals , forType : TargetImpl } ) ;
110
115
let cache : TestTargetCache ;
111
116
112
117
const QUERY_ROOMS = Query . atPath ( path ( 'rooms' ) ) . toTarget ( ) ;
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ import { SpecBuilder } from './spec_builder';
26
26
import { SpecStep } from './spec_test_runner' ;
27
27
28
28
import * as stringify from 'json-stable-stringify' ;
29
- import { Target , targetEquals } from '../../../src/core/target' ;
29
+ import { Target , targetEquals , TargetImpl } from '../../../src/core/target' ;
30
30
31
31
// Disables all other tests; useful for debugging. Multiple tests can have
32
32
// this tag and they'll all be run (but all others won't).
@@ -240,7 +240,7 @@ export function describeSpec(
240
240
241
241
if ( ! writeJSONFile ) {
242
242
describe ( name , ( ) => {
243
- addEqualityMatcher ( { equalsFn : targetEquals , forType : Target } ) ;
243
+ addEqualityMatcher ( { equalsFn : targetEquals , forType : TargetImpl } ) ;
244
244
return builder ( ) ;
245
245
} ) ;
246
246
} else {
You can’t perform that action at this time.
0 commit comments