diff options
Diffstat (limited to 'test/helper.js')
-rw-r--r-- | test/helper.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test/helper.js b/test/helper.js index aaac7580e..a3abbebf2 100644 --- a/test/helper.js +++ b/test/helper.js @@ -1,3 +1,7 @@ +import Enzyme from 'enzyme' +import Adapter from 'enzyme-adapter-react-15' + +Enzyme.configure({ adapter: new Adapter() }) // disallow promises from swallowing errors enableFailureOnUnhandledPromiseRejection() @@ -20,14 +24,12 @@ window.localStorage = {} if (!window.crypto) window.crypto = {} if (!window.crypto.getRandomValues) window.crypto.getRandomValues = require('polyfill-crypto.getrandomvalues') - - -function enableFailureOnUnhandledPromiseRejection() { +function enableFailureOnUnhandledPromiseRejection () { // overwrite node's promise with the stricter Bluebird promise global.Promise = require('bluebird') // modified from https://github.com/mochajs/mocha/issues/1926#issuecomment-180842722 - + // rethrow unhandledRejections if (typeof process !== 'undefined') { process.on('unhandledRejection', function (reason) { @@ -51,4 +53,4 @@ function enableFailureOnUnhandledPromiseRejection() { typeof (console.error || console.log) === 'function') { (console.error || console.log)('Unhandled rejections will be ignored!') } -}
\ No newline at end of file +} |