#232: switch to jsdom instead of phantomjs

This commit is contained in:
SleepWalker
2016-12-04 14:11:23 +02:00
parent 146cbcd922
commit 0178803df0
5 changed files with 162 additions and 109 deletions

View File

@@ -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?$/);

View File

@@ -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', () => {