You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Testing local storage in unit tests does not appear to be possible.
Description
I want to test that our use of getStorageManager() with gvlid and bidderCode specified is working correctly. Nevertheless, whenever I run my unit test, isValid(cb) within storageManager.js always returns undefined because the callback in validateStorageEnforcement is never executed.
First, I recommend using serve-and-test instead of test during development - it's quite a bit faster (it skips linting and doesn't need to recompile the world on each test run).
To solve your issue, add this at the top of your _spec.js file:
import {hook} from 'src/hook.js';
before(() => {
hook.ready();
});
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: