Skip to content

Commit 3ebcf82

Browse files
committed
Fix integration tests that run on the built packages
1 parent 41a618e commit 3ebcf82

File tree

4 files changed

+44
-4
lines changed

4 files changed

+44
-4
lines changed

integration/firestore/gulpfile.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,23 @@ if (typeof process === 'undefined') {
6969
`
7070
)
7171
)
72+
.pipe(
73+
replace(
74+
/**
75+
* This regex is designed to match the Firebase import in our
76+
* integration tests.
77+
*/
78+
/\s+from '\.(\.\/util)?\/pipeline_export';/,
79+
` from '${resolve(__dirname, './pipeline_export')}';
80+
81+
if (typeof process === 'undefined') {
82+
process = { env: { INCLUDE_FIRESTORE_PERSISTENCE: '${isPersistenceEnabled()}' } } as any;
83+
} else {
84+
process.env.INCLUDE_FIRESTORE_PERSISTENCE = '${isPersistenceEnabled()}';
85+
}
86+
`
87+
)
88+
)
7289
.pipe(
7390
/**
7491
* Fixing the project.json require to properly reference the file
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* @license
3+
* Copyright 2025 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
// This file replaces "packages/firestore/test/integration/util/pipeline_export"
19+
// and depends on the minified sources.
20+
21+
export * from '@firebase/firestore/pipelines';

packages/firestore/test/integration/api/pipeline.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import { FirebaseError } from '@firebase/util';
1919
import { expect, use } from 'chai';
2020
import chaiAsPromised from 'chai-as-promised';
2121

22-
import { PipelineSnapshot } from '../../../src/lite-api/pipeline-result';
2322
import { addEqualityMatcher } from '../../util/equality_matcher';
2423
import { Deferred } from '../../util/promise';
2524
import {
@@ -145,7 +144,8 @@ import {
145144
ifAbsent,
146145
join,
147146
log10,
148-
arraySum
147+
arraySum,
148+
PipelineSnapshot
149149
} from '../util/pipeline_export';
150150

151151
use(chaiAsPromised);

packages/firestore/test/integration/api/query_to_pipeline.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import { expect, use } from 'chai';
1919
import chaiAsPromised from 'chai-as-promised';
2020

21-
import { PipelineSnapshot } from '../../../src/lite-api/pipeline-result';
2221
import { addEqualityMatcher } from '../../util/equality_matcher';
2322
import {
2423
doc,
@@ -49,7 +48,10 @@ import {
4948
withTestCollection,
5049
itIf
5150
} from '../util/helpers';
52-
import { execute } from '../util/pipeline_export';
51+
import {
52+
execute,
53+
PipelineSnapshot
54+
} from '../util/pipeline_export';
5355

5456
use(chaiAsPromised);
5557

0 commit comments

Comments
 (0)