Skip to content

Commit e18d8da

Browse files
authored
More v19 enhancements (#3586)
* Pending tasks and data-connect * Migrating to pendingUntilEvent * Starting to refactor test suite * Bumping eslint * Disabiling compat/firestore tests for now
1 parent a58b329 commit e18d8da

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+6940
-824
lines changed

firebase.json

+17-1
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,21 @@
2828
"ui": {
2929
"enabled": false
3030
}
31-
}
31+
},
32+
"functions": [
33+
{
34+
"source": "test/functions",
35+
"codebase": "default",
36+
"ignore": [
37+
"node_modules",
38+
".git",
39+
"firebase-debug.log",
40+
"firebase-debug.*.log",
41+
"*.local"
42+
],
43+
"predeploy": [
44+
"npm --prefix \"$RESOURCE_DIR\" run build"
45+
]
46+
}
47+
]
3248
}

karma.conf.js

+24-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,22 @@ const dns = require('node:dns');
33
// The emulator suite fails in CI, only on Node 18.
44
// This apparently fixes it.
55
// https://github.com/firebase/firebase-tools/issues/5755#issuecomment-1535445383
6-
dns.setDefaultResultOrder('ipv4first')
6+
dns.setDefaultResultOrder('ipv4first');
7+
8+
let firestoreEmulatorPort, storageEmulatorPort, authEmulatorPort, databaseEmulatorPort, functionsEmulatorPort;
9+
if (process.env.FIRESTORE_EMULATOR_HOST &&
10+
process.env.STORAGE_EMULATOR_HOST &&
11+
process.env.FIREBASE_AUTH_EMULATOR_HOST &&
12+
process.env.FIREBASE_DATABASE_EMULATOR_HOST) {
13+
firestoreEmulatorPort = parseInt(process.env.FIRESTORE_EMULATOR_HOST.split(":")[1], 10); // '127.0.0.1:9098'
14+
storageEmulatorPort = parseInt(process.env.STORAGE_EMULATOR_HOST.split(":")[2], 10); // 'http://127.0.0.1:9199'
15+
authEmulatorPort = parseInt(process.env.FIREBASE_AUTH_EMULATOR_HOST.split(":")[1], 10); // '127.0.0.1:9098'
16+
databaseEmulatorPort = parseInt(process.env.FIREBASE_DATABASE_EMULATOR_HOST.split(":")[1], 10); // '127.0.0.1:9002'
17+
functionsEmulatorPort = 5001; // TODO figure out why this env variable isn't present
18+
} else {
19+
console.error("Missing emulator environments variables");
20+
process.exit(1);
21+
}
722

823
// Karma configuration file, see link for more information
924
// https://karma-runner.github.io/1.0/config/configuration-file.html
@@ -21,7 +36,14 @@ module.exports = function (config) {
2136
require('@angular-devkit/build-angular/plugins/karma')
2237
],
2338
client: {
24-
clearContext: false // leave Jasmine Spec Runner output visible in browser
39+
clearContext: false, // leave Jasmine Spec Runner output visible in browser
40+
args: [
41+
["FIRESTORE_EMULATOR_PORT", firestoreEmulatorPort],
42+
["DATABASE_EMULATOR_PORT", databaseEmulatorPort],
43+
["STORAGE_EMULATOR_PORT", storageEmulatorPort],
44+
["AUTH_EMULATOR_PORT", authEmulatorPort],
45+
["FUNCTIONS_EMULATOR_PORT", functionsEmulatorPort],
46+
],
2547
},
2648
coverageIstanbulReporter: {
2749
dir: `${process.cwd()}/coverage`,

package-lock.json

+21-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
"private": true,
66
"scripts": {
77
"test": "npm run build:jasmine && npm run test:node-esm && npm run test:chrome-headless",
8-
"test:watch": "npx --yes firebase-tools@latest emulators:exec --project=demo123 \"ng test --watch=true --browsers=Chrome\"",
9-
"test:chrome": "npx --yes firebase-tools@latest emulators:exec --project=demo123 \"ng test --watch=false --browsers=Chrome\"",
10-
"test:firefox": "npx --yes firebase-tools@latest emulators:exec --project=demo123 \"ng test --watch=false --browsers=Firefox\"",
11-
"test:safari": "npx --yes firebase-tools@latest emulators:exec --project=demo123 \"ng test --watch=false --browsers=SafariNative\"",
12-
"test:chrome-headless": "npx --yes firebase-tools@latest emulators:exec --project=demo123 \"ng test --watch=false --browsers=ChromeHeadless\"",
13-
"test:firefox-headless": "npx --yes firebase-tools@latest emulators:exec --project=demo123 \"ng test --watch=false --browsers=FirefoxHeadless\"",
8+
"test:watch": "npx --yes firebase-tools@latest emulators:exec --project=demo-123 \"ng test --watch=true --browsers=Chrome\"",
9+
"test:chrome": "npx --yes firebase-tools@latest emulators:exec --project=demo-123 \"ng test --watch=false --browsers=Chrome\"",
10+
"test:firefox": "npx --yes firebase-tools@latest emulators:exec --project=demo-123 \"ng test --watch=false --browsers=Firefox\"",
11+
"test:safari": "npx --yes firebase-tools@latest emulators:exec --project=demo-123 \"ng test --watch=false --browsers=SafariNative\"",
12+
"test:chrome-headless": "npx --yes firebase-tools@latest emulators:exec --project=demo-123 \"ng test --watch=false --browsers=ChromeHeadless\"",
13+
"test:firefox-headless": "npx --yes firebase-tools@latest emulators:exec --project=demo-123 \"ng test --watch=false --browsers=FirefoxHeadless\"",
1414
"lint": "ng lint",
1515
"test:node": "node -r tsconfig-paths/register ./dist/out-tsc/jasmine/tools/jasmine.mjs --input-type=commonjs",
1616
"test:node-esm": "node -r tsconfig-paths/register ./dist/out-tsc/jasmine/tools/jasmine.mjs",
@@ -75,8 +75,8 @@
7575
},
7676
"devDependencies": {
7777
"@angular-devkit/build-angular": "^19.0.0",
78-
"@angular-eslint/builder": "19.0.0-alpha.0",
79-
"@angular-eslint/eslint-plugin": "19.0.0-alpha.0",
78+
"@angular-eslint/builder": "^19.0.0",
79+
"@angular-eslint/eslint-plugin": "^19.0.0",
8080
"@angular/animations": "^19.0.0",
8181
"@angular/cli": "^19.0.0",
8282
"@angular/compiler-cli": "^19.0.0",

samples/advanced/src/app/app-check/app-check.component.ts

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/advanced/src/app/storage/storage.component.ts

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/advanced/src/app/upboats/lazyFirestore.ts

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/modular/src/app/app-check/app-check.component.ts

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/modular/src/app/storage/storage.component.ts

+2-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/auth/auth.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { TestBed } from '@angular/core/testing';
22
import { FirebaseApp, getApp, initializeApp, provideFirebaseApp } from '@angular/fire/app';
33
import { Auth, connectAuthEmulator, getAuth, provideAuth } from '@angular/fire/auth';
4-
import { COMMON_CONFIG } from '../test-config';
4+
import { COMMON_CONFIG, authEmulatorPort } from '../test-config';
55
import { rando } from '../utils';
66

77
describe('Auth', () => {
@@ -19,7 +19,7 @@ describe('Auth', () => {
1919
provideFirebaseApp(() => initializeApp(COMMON_CONFIG, appName)),
2020
provideAuth(() => {
2121
providedAuth = getAuth(getApp(appName));
22-
connectAuthEmulator(providedAuth, 'http://localhost:9099');
22+
connectAuthEmulator(providedAuth, `http://localhost:${authEmulatorPort}`);
2323
return providedAuth;
2424
}),
2525
],

0 commit comments

Comments
 (0)