-
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
Enabling local storage in unit tests via the getStorageManager() #9348
Comments
First, I recommend using To solve your issue, add this at the top of your
|
Fwiw, it does work when you run all the tests, the problem at hand is that it doesnt work when you only run this subset of the tests. |
That does the trick! Thanks muchly. And thanks muchly for merging the change to master to enable this by default. |
Type of issue
Testing local storage in unit tests does not appear to be possible.
Description
I want to test that our use of
getStorageManager()
withgvlid
andbidderCode
specified is working correctly. Nevertheless, whenever I run my unit test,isValid(cb)
withinstorageManager.js
always returns undefined because the callback invalidateStorageEnforcement
is never executed.Steps to reproduce
In any unit test, set up the following:
You will then find that the callback in
validateStorageEnforcement
viaisValid(cb)
is never executed.Expected results
There should be a way to enable local storage in unit tests.
Other information
This is what I use to run the tests:
gulp test --file ./test/spec/modules/adnuntiusBidAdapter_spec.js
The text was updated successfully, but these errors were encountered: