Skip to content

Commit ec0564b

Browse files
committed
Run directly from ts file to avoid compiler problems.
1 parent 2d2bbb3 commit ec0564b

File tree

4 files changed

+12
-27
lines changed

4 files changed

+12
-27
lines changed

packages/firestore/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
2222
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
2323
"prettier": "prettier --write '*.js' '@(lite|src|test)/**/*.ts'",
24-
"test:lite": "node ./scripts/run-tests.js --emulator --platform node_lite --main=lite/index.ts 'test/lite/**/*.test.ts'",
25-
"test:lite:prod": "node ./scripts/run-tests.js --platform node_lite --main=lite/index.ts 'test/lite/**/*.test.ts'",
24+
"test:lite": "ts-node ./scripts/run-tests.ts --emulator --platform node_lite --main=lite/index.ts 'test/lite/**/*.test.ts'",
25+
"test:lite:prod": "ts-node ./scripts/run-tests.ts --platform node_lite --main=lite/index.ts 'test/lite/**/*.test.ts'",
2626
"test:lite:browser": "karma start --single-run --lite",
2727
"test:lite:browser:debug": "karma start --browsers=Chrome --lite --auto-watch",
2828
"test": "run-s lint test:all",
@@ -34,10 +34,10 @@
3434
"test:browser:emulator": "karma start --single-run --targetBackend=emulator",
3535
"test:browser:unit": "karma start --single-run --unit",
3636
"test:browser:debug": "karma start --browsers=Chrome --auto-watch",
37-
"test:node": "node ./scripts/run-tests.js --main=test/register.ts --emulator 'test/{,!(browser|lite)/**/}*.test.ts'",
38-
"test:node:prod": "node ./scripts/run-tests.js --main=test/register.ts 'test/{,!(browser|lite)/**/}*.test.ts'",
39-
"test:node:persistence": "node ./scripts/run-tests.js --main=test/register.ts --persistence --emulator 'test/{,!(browser|lite)/**/}*.test.ts'",
40-
"test:node:persistence:prod": "node ./scripts/run-tests.js --main=test/register.ts --persistence 'test/{,!(browser|lite)/**/}*.test.ts'",
37+
"test:node": "ts-node ./scripts/run-tests.ts --main=test/register.ts --emulator 'test/{,!(browser|lite)/**/}*.test.ts'",
38+
"test:node:prod": "ts-node ./scripts/run-tests.ts --main=test/register.ts 'test/{,!(browser|lite)/**/}*.test.ts'",
39+
"test:node:persistence": "ts-node ./scripts/run-tests.ts --main=test/register.ts --persistence --emulator 'test/{,!(browser|lite)/**/}*.test.ts'",
40+
"test:node:persistence:prod": "ts-node ./scripts/run-tests.ts --main=test/register.ts --persistence 'test/{,!(browser|lite)/**/}*.test.ts'",
4141
"test:travis": "ts-node --compiler-options='{\"module\":\"commonjs\"}' ../../scripts/emulator-testing/firestore-test-runner.ts",
4242
"test:minified": "(cd ../../integration/firestore ; yarn test)",
4343
"api-report:main": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' ts-node ../../repo-scripts/prune-dts/extract-public-api.ts --package firestore --packageRoot . --typescriptDts ./dist/firestore/src/index.d.ts --rollupDts ./dist/private.d.ts --untrimmedRollupDts ./dist/internal.d.ts --publicDts ./dist/index.d.ts",

packages/firestore/scripts/run-tests.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

scripts/emulator-testing/emulators/emulator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export abstract class Emulator {
3535
constructor(
3636
private binaryName: string,
3737
private binaryUrl: string,
38-
public port: number
38+
public readonly port: number
3939
) {
4040
this.cacheDirectory = path.join(os.homedir(), `.cache/firebase-js-sdk`);
4141
this.cacheBinaryPath = path.join(this.cacheDirectory, binaryName);

scripts/emulator-testing/firestore-test-runner.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,17 @@ import * as path from 'path';
2626
import freePortFinder from 'find-free-port';
2727

2828
import { FirestoreEmulator } from './emulators/firestore-emulator';
29+
import {SpawnOptions} from "child_process";
2930

3031
function runTest(port: number, projectId: string, withPersistence: boolean) {
3132
const options = {
3233
cwd: path.resolve(__dirname, '../../packages/firestore'),
33-
env: Object.assign({}, process.env, {
34+
env: {
35+
...process.env,
3436
FIRESTORE_TARGET_BACKEND: 'emulator',
35-
FIRESTORE_EMULATOR_PORT: port,
37+
FIRESTORE_EMULATOR_PORT: String(port),
3638
FIRESTORE_EMULATOR_PROJECT_ID: projectId
37-
}),
39+
},
3840
stdio: 'inherit' as const
3941
};
4042
// TODO(b/113267261): Include browser test once WebChannel support is

0 commit comments

Comments
 (0)