Skip to content

Commit

Permalink
Andrew s/slimmer (#51)
Browse files Browse the repository at this point in the history
* Remove function

* remove test mode
  • Loading branch information
andrew-sotiriou authored May 7, 2024
1 parent 6f377d9 commit 4a8ab07
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions src/createManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ export const APIToCallBeforeServiceEnabled = [
export class AdManager extends EventEmitter {
constructor(config = {}) {
super(config);

if (config.test) {
this.testMode = config;
}
}

_config = {
Expand All @@ -62,8 +58,6 @@ export class AdManager extends EventEmitter {

_syncCorrelator = false;

_testMode = false;

get googletag() {
return this._googletag;
}
Expand All @@ -84,27 +78,6 @@ export class AdManager extends EventEmitter {
return this.googletag && this.googletag.pubadsReady;
}

get testMode() {
return this._testMode;
}

set testMode(config) {
if (process.env.NODE_ENV === "production") {
return;
}
const {test, GPTMock} = config;
this._isLoaded = true;
this._testMode = !!test;

if (test) {
invariant(
test && GPTMock,
"Must provide GPTMock to enable testMode. config{GPTMock}"
);
this._googletag = new GPTMock(config);
}
}

_processPubadsQueue() {
if (this._pubadsProxyQueue) {
Object.keys(this._pubadsProxyQueue).forEach(method => {
Expand Down Expand Up @@ -159,10 +132,6 @@ export class AdManager extends EventEmitter {
instance.foldCheck(event);
}
});

if (this.testMode) {
this._getTimer();
}
});

_getTimer() {
Expand Down Expand Up @@ -488,11 +457,6 @@ export class AdManager extends EventEmitter {
return (
this._loadPromise ||
(this._loadPromise = new Promise((resolve, reject) => {
// test mode can't be enabled in production mode
if (this.testMode) {
resolve(this.googletag);
return;
}
if (!canUseDOM) {
reject(new Error("DOM not available"));
return;
Expand Down

0 comments on commit 4a8ab07

Please sign in to comment.