Skip to content

Commit eb734d1

Browse files
committed
Fix analytics and functions Saucelabs tests
1 parent 1d3b2ec commit eb734d1

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

packages/analytics/index.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ describe('FirebaseAnalytics instance tests', () => {
8888
currency: 'USD'
8989
});
9090
// Clear event stack of async FID call.
91-
await fidDeferred.promise;
91+
// For IE: Need to wrap it in another function as FID fetch is wrapped in initializeGAId.
92+
await (() => fidDeferred.promise);
9293
expect(gtagStub).to.have.been.calledWith('js');
9394
expect(gtagStub).to.have.been.calledWith(
9495
GtagCommand.CONFIG,
@@ -158,7 +159,8 @@ describe('FirebaseAnalytics instance tests', () => {
158159
currency: 'USD'
159160
});
160161
// Clear event stack of async FID call.
161-
await fidDeferred.promise;
162+
// For IE: Need to wrap it in another function as FID fetch is wrapped in initializeGAId.
163+
await (() => fidDeferred.promise);
162164
expect(gtagStub).to.have.been.calledWith('js');
163165
expect(gtagStub).to.have.been.calledWith(
164166
GtagCommand.CONFIG,

packages/functions/karma.conf.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,14 @@
1515
* limitations under the License.
1616
*/
1717

18-
const karma = require('karma');
19-
const path = require('path');
2018
const karmaBase = require('../../config/karma.base');
2119

2220
const files = [`test/**/*`];
2321

2422
module.exports = function(config) {
2523
const karmaConfig = Object.assign({}, karmaBase, {
2624
// files to load into karma
27-
files: files,
25+
files,
2826
// frameworks to use
2927
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
3028
frameworks: ['mocha']

packages/functions/test/browser/callable.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ describe('Firebase Functions > Call', () => {
4343
// TODO(klimt): Move this to the cross-platform tests and delete this file,
4444
// once instance id works there.
4545
it('instance id', async () => {
46+
if (!('Notification' in self)) {
47+
console.log('No Notification API: skipping instance id test.');
48+
return;
49+
}
4650
// mock firebase messaging
4751
const messagingMock: FirebaseMessaging = ({
4852
getToken: async () => 'iid'

0 commit comments

Comments
 (0)