Skip to content

Commit 684e5e4

Browse files
committed
Update function name to more accurately reflect usage
1 parent 2ab2d8c commit 684e5e4

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

packages/analytics/src/helpers.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {
2929
import { GtagCommand } from './constants';
3030
import { Deferred } from '@firebase/util';
3131
import { ConsentSettings } from './public-types';
32-
import { removeGtagScript } from '../testing/gtag-script-util';
32+
import { removeGtagScripts } from '../testing/gtag-script-util';
3333

3434
const fakeMeasurementId = 'abcd-efgh-ijkl';
3535
const fakeAppId = 'my-test-app-1234';
@@ -48,8 +48,7 @@ const fakeDynamicConfigPromises = [Promise.resolve(fakeDynamicConfig)];
4848

4949
describe('Gtag wrapping functions', () => {
5050
afterEach(() => {
51-
delete window['gtag'];
52-
removeGtagScript();
51+
removeGtagScripts();
5352
});
5453

5554
it('getOrCreateDataLayer is able to create a new data layer if none exists', () => {

packages/analytics/src/index.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
import { FirebaseApp } from '@firebase/app';
2727
import { GtagCommand } from './constants';
2828
import { findGtagScriptOnPage } from './helpers';
29-
import { removeGtagScript } from '../testing/gtag-script-util';
29+
import { removeGtagScripts } from '../testing/gtag-script-util';
3030
import { Deferred } from '@firebase/util';
3131
import { AnalyticsError } from './errors';
3232
import { logEvent } from './api';
@@ -150,7 +150,7 @@ describe('FirebaseAnalytics instance tests', () => {
150150
after(() => {
151151
delete window['gtag'];
152152
delete window['dataLayer'];
153-
removeGtagScript();
153+
removeGtagScripts();
154154
fetchStub.restore();
155155
clock.restore();
156156
idbOpenStub.restore();
@@ -208,7 +208,7 @@ describe('FirebaseAnalytics instance tests', () => {
208208
afterEach(() => {
209209
delete window['gtag'];
210210
delete window['dataLayer'];
211-
removeGtagScript();
211+
removeGtagScripts();
212212
fetchStub.restore();
213213
clock.restore();
214214
warnStub.restore();
@@ -304,7 +304,7 @@ describe('FirebaseAnalytics instance tests', () => {
304304
after(() => {
305305
delete window[customGtagName];
306306
delete window[customDataLayerName];
307-
removeGtagScript();
307+
removeGtagScripts();
308308
fetchStub.restore();
309309
clock.restore();
310310
idbOpenStub.restore();
@@ -355,7 +355,7 @@ describe('FirebaseAnalytics instance tests', () => {
355355

356356
delete window['gtag'];
357357
delete window['dataLayer'];
358-
removeGtagScript();
358+
removeGtagScripts();
359359
fetchStub.restore();
360360
idbOpenStub.restore();
361361
});

packages/analytics/src/initialize-analytics.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import { DynamicConfig } from './types';
2828
import { FirebaseApp } from '@firebase/app';
2929
import { Deferred } from '@firebase/util';
3030
import { _FirebaseInstallationsInternal } from '@firebase/installations';
31-
import { removeGtagScript } from '../testing/gtag-script-util';
31+
import { removeGtagScripts } from '../testing/gtag-script-util';
3232
import { setDefaultEventParameters } from './api';
3333
import {
3434
defaultConsentSettingsForInit,
@@ -68,7 +68,7 @@ describe('initializeAnalytics()', () => {
6868
});
6969
afterEach(() => {
7070
fetchStub.restore();
71-
removeGtagScript();
71+
removeGtagScripts();
7272
});
7373
it('gets FID and measurement ID and calls gtag config with them', async () => {
7474
stubFetch();

packages/analytics/testing/gtag-script-util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
import { GTAG_URL } from '../src/constants';
1818

19-
export function removeGtagScript(): void {
19+
export function removeGtagScripts(): void {
2020
const scriptTags = window.document.getElementsByTagName('script');
2121
for (const tag of Object.values(scriptTags)) {
2222
if (tag.src) {

0 commit comments

Comments
 (0)