Skip to content

Commit fada25b

Browse files
author
Guillermo Tamanaha
committed
Mock test group for testing
1 parent 5e2c179 commit fada25b

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

src/Rokt-Kit.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ var constructor = function () {
318318
launcherOptions || {}
319319
);
320320

321-
if(self.isPartnerInLocalLauncherTestGroup()){
321+
if(isPartnerInLocalLauncherTestGroup()){
322322
var localLauncher = window.Rokt.createLocalLauncher(options);
323323
initRoktLauncher(localLauncher);
324324
}
@@ -410,7 +410,7 @@ var constructor = function () {
410410
this.setUserAttribute = setUserAttribute;
411411
this.onUserIdentified = onUserIdentified;
412412
this.removeUserAttribute = removeUserAttribute;
413-
this.isPartnerInLocalLauncherTestGroup = isPartnerInLocalLauncherTestGroup;
413+
this.testGroup = [382761173318339093846102813504170n];
414414

415415
/**
416416
* Checks if the Rokt kit is ready to use.
@@ -424,12 +424,11 @@ var constructor = function () {
424424
}
425425

426426
function isPartnerInLocalLauncherTestGroup() {
427-
var testGroup = [382761173318339093846102813504170n];
428427
var url = new URL(window.location.href);
429428
var { hostname } = url;
430429
var hash = hashString(hostname);
431430

432-
return testGroup.includes(hash);
431+
return self.testGroup.includes(hash);
433432
}
434433

435434
/**

test/src/tests.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,8 @@ describe('Rokt Forwarder', () => {
561561
},
562562
},
563563
};
564-
window.mParticle.forwarder.isPartnerInLocalLauncherTestGroup = () => false;
564+
565+
window.mParticle.forwarder.testGroup =[11111111111111n];
565566
});
566567

567568
it('should create a remote launcher if the partner is not in the local launcher test group', async () => {
@@ -578,7 +579,8 @@ describe('Rokt Forwarder', () => {
578579
});
579580

580581
it('should create a local launcher if the partner is in the local launcher test group', async () => {
581-
window.mParticle.forwarder.isPartnerInLocalLauncherTestGroup = () => true;
582+
window.mParticle.forwarder.testGroup =[249896952128253326n];
583+
582584
await window.mParticle.forwarder.init(
583585
{ accountId: '123456' },
584586
reportService.cb,

0 commit comments

Comments
 (0)