Skip to content

Commit 6c94626

Browse files
committed
test(database, other): eliminate warning about firebase double-loading
the package @firebase/rules-unit-testing loads the firebase library for its own purposes, and on the Other platform we also load it
1 parent b86b7e3 commit 6c94626

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

packages/database/e2e/helpers.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1+
// Eliminate annoying warning about double-loading firebase while
2+
// on Other platform - we load it, and rules-unit-testing does as well
3+
4+
// eslint-disable-next-line no-console
5+
const originalConsoleWarn = console.warn;
6+
// eslint-disable-next-line no-console
7+
console.warn = function (message) {
8+
if (message && typeof message === 'string' && !message.includes('@firebase/app-compat')) {
9+
originalConsoleWarn(message);
10+
}
11+
};
112
const testingUtils = require('@firebase/rules-unit-testing');
13+
// eslint-disable-next-line no-console
14+
console.warn = originalConsoleWarn;
15+
216
const { getE2eTestProject, getE2eEmulatorHost } = require('../../app/e2e/helpers');
317

418
// TODO make more unique?

0 commit comments

Comments
 (0)