mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-05-31 14:11:58 +05:30
#232: switch to jsdom instead of phantomjs
This commit is contained in:
@@ -3,6 +3,24 @@ import 'polyfills';
|
||||
import expect from 'unexpected';
|
||||
expect.use(require('unexpected-sinon'));
|
||||
|
||||
if (!window.localStorage) {
|
||||
window.localStorage = {
|
||||
getItem(key) {
|
||||
return this[key];
|
||||
},
|
||||
setItem(key, value) {
|
||||
this[key] = value;
|
||||
},
|
||||
removeItem(key) {
|
||||
delete this[key];
|
||||
}
|
||||
};
|
||||
|
||||
window.sessionStorage = {
|
||||
...window.localStorage
|
||||
};
|
||||
}
|
||||
|
||||
// require all modules ending in "_test" from the
|
||||
// current directory and all subdirectories
|
||||
const testsContext = require.context('.', true, /\.test\.jsx?$/);
|
||||
|
||||
@@ -30,8 +30,8 @@ describe('AuthFlow', () => {
|
||||
});
|
||||
|
||||
it('should not allow to mutate actions', () => {
|
||||
expect(() => flow.actions.foo = 'bar', 'to throw', /readonly/);
|
||||
expect(() => flow.actions.test = 'hacked', 'to throw', /readonly/);
|
||||
expect(() => flow.actions.foo = 'bar', 'to throw', /readonly|not extensible/);
|
||||
expect(() => flow.actions.test = 'hacked', 'to throw', /read ?only/);
|
||||
});
|
||||
|
||||
describe('#setStore', () => {
|
||||
|
||||
Reference in New Issue
Block a user