Skip to content

Commit 6cc9a07

Browse files
authored
ci: Fix Firefox error and streamline cross-browser tests (#9015)
1 parent 5871fd6 commit 6cc9a07

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

packages/util/test/errors.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ describe('FirebaseError', () => {
8989
throw e;
9090
} catch (error) {
9191
assert.isDefined((error as Error).stack);
92-
// Multi-line match trick - .* does not match \n
93-
assert.match((error as Error).stack!, /FirebaseError[\s\S]/);
92+
// Firefox no longer puts the error class name in the stack
93+
// as of 139.0 so we don't have a string to match on.
9494
}
9595
});
9696

scripts/run_tests_in_ci.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ const crossBrowserPackages = {
2727
'packages/auth': 'test:browser:unit',
2828
'packages/auth-compat': 'test:browser:unit',
2929
'packages/firestore': 'test:browser:unit',
30-
'packages/firestore-compat': 'test:browser'
30+
'packages/firestore-compat': 'test:browser',
31+
'packages/storage': 'test:browser:unit',
32+
'packages/storage-compat': 'test:browser:unit'
3133
};
3234

3335
function writeLogs(status, name, logText) {
@@ -59,17 +61,27 @@ const argv = yargs.options({
5961
const myPath = argv.d;
6062
let scriptName = argv.s;
6163
const dir = path.resolve(myPath);
62-
const { name } = require(`${dir}/package.json`);
64+
const { name, scripts } = require(`${dir}/package.json`);
6365

6466
let testProcessOutput = '';
6567
try {
6668
if (process.env?.BROWSERS) {
69+
if (scripts['test:browser']) {
70+
scriptName = 'test:browser';
71+
}
6772
for (const package in crossBrowserPackages) {
6873
if (dir.endsWith(package)) {
6974
scriptName = crossBrowserPackages[package];
7075
}
7176
}
7277
}
78+
79+
console.log(
80+
`[${name}][${
81+
process.env.BROWSERS ?? 'chrome/node'
82+
}]: Running script ${scriptName}`
83+
);
84+
7385
const testProcess = spawn('yarn', ['--cwd', dir, scriptName]);
7486

7587
testProcess.childProcess.stdout.on('data', data => {

0 commit comments

Comments
 (0)