From 0d4f64faa1297b70c273f3844ba809aac2a5ec8b Mon Sep 17 00:00:00 2001 From: Karim Mourra Date: Tue, 13 Sep 2022 18:50:10 -0400 Subject: [PATCH] refactor tests --- test/spec/modules/videoModule/pbVideo_spec.js | 1 - test/spec/modules/videoModule/shared/state_spec.js | 2 +- .../videoModule/submodules/jwplayerVideoProvider_spec.js | 9 +++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/spec/modules/videoModule/pbVideo_spec.js b/test/spec/modules/videoModule/pbVideo_spec.js index d8eeccfd06cf..3bef58e78a47 100644 --- a/test/spec/modules/videoModule/pbVideo_spec.js +++ b/test/spec/modules/videoModule/pbVideo_spec.js @@ -1,7 +1,6 @@ import { expect } from 'chai'; import { PbVideo } from 'modules/videoModule'; import CONSTANTS from 'src/constants.json'; -import { AD_IMPRESSION, AD_ERROR, BID_IMPRESSION, BID_ERROR } from 'libraries/video/constants/events.js'; let ortbVideoMock; let ortbContentMock; diff --git a/test/spec/modules/videoModule/shared/state_spec.js b/test/spec/modules/videoModule/shared/state_spec.js index bbd0a35b57e1..94f3cb734110 100644 --- a/test/spec/modules/videoModule/shared/state_spec.js +++ b/test/spec/modules/videoModule/shared/state_spec.js @@ -3,7 +3,7 @@ import { expect } from 'chai'; describe('State', function () { let state = stateFactory(); - beforeEach(function () { + beforeEach(() => { state.clearState(); }); diff --git a/test/spec/modules/videoModule/submodules/jwplayerVideoProvider_spec.js b/test/spec/modules/videoModule/submodules/jwplayerVideoProvider_spec.js index 3aeb82bcf738..3d25f665ce09 100644 --- a/test/spec/modules/videoModule/submodules/jwplayerVideoProvider_spec.js +++ b/test/spec/modules/videoModule/submodules/jwplayerVideoProvider_spec.js @@ -313,7 +313,7 @@ describe('JWPlayerProvider', function () { describe('adStateFactory', function () { let adState = adStateFactory(); - beforeEach(function() { + beforeEach(() => { adState.clearState(); }); @@ -447,7 +447,7 @@ describe('adStateFactory', function () { describe('timeStateFactory', function () { let timeState = timeStateFactory(); - beforeEach(function() { + beforeEach(() => { timeState.clearState(); }); @@ -500,7 +500,7 @@ describe('timeStateFactory', function () { describe('callbackStorageFactory', function () { let callbackStorage = callbackStorageFactory(); - beforeEach(function () { + beforeEach(() => { callbackStorage.clearStorage(); }); @@ -774,8 +774,9 @@ describe('utils', function () { describe('isOmidSupported', function () { const isOmidSupported = utils.isOmidSupported; + const initialOmidSessionClient = window.OmidSessionClient; afterEach(() => { - window.OmidSessionClient = undefined; + window.OmidSessionClient = initialOmidSessionClient; }); it('should be true when Omid is loaded and client is VAST', function () {