accounts-frontend/src/test.js

31 lines
769 B
JavaScript
Raw Normal View History

import 'polyfills';
2019-01-15 02:10:25 +05:30
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
2016-07-30 16:14:43 +05:30
import expect from 'unexpected';
2019-01-15 02:10:25 +05:30
2016-07-30 16:14:43 +05:30
expect.use(require('unexpected-sinon'));
2019-01-15 02:10:25 +05:30
configure({ adapter: new Adapter() });
2016-07-30 16:14:43 +05:30
if (!window.localStorage) {
window.localStorage = {
getItem(key) {
return this[key] || null;
},
setItem(key, value) {
this[key] = value;
},
removeItem(key) {
delete this[key];
}
};
window.sessionStorage = {
...window.localStorage
};
}
// require all modules ending in ".test.js" from the
// current directory and all subdirectories
2016-07-30 16:14:43 +05:30
const testsContext = require.context('.', true, /\.test\.jsx?$/);
testsContext.keys().forEach(testsContext);