diff options
Diffstat (limited to 'spec/javascripts/test_bundle.js')
-rw-r--r-- | spec/javascripts/test_bundle.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/javascripts/test_bundle.js b/spec/javascripts/test_bundle.js index fd7aa332d17..609b238cdde 100644 --- a/spec/javascripts/test_bundle.js +++ b/spec/javascripts/test_bundle.js @@ -11,11 +11,16 @@ const isHeadlessChrome = /\bHeadlessChrome\//.test(navigator.userAgent); Vue.config.devtools = !isHeadlessChrome; Vue.config.productionTip = false; +const nonce = 9999 * Math.random(); +console.log('test_bundle.js', nonce, isHeadlessChrome, new Error().stack); + let hasVueWarnings = false; +/* * / Vue.config.warnHandler = (msg, vm, trace) => { hasVueWarnings = true; fail(`${msg}${trace}`); }; +/* */ Vue.use(VueResource); @@ -40,6 +45,21 @@ window.addEventListener('unhandledrejection', (event) => { console.error(event.reason.stack || event.reason); }); +beforeAll(() => { + /* */ + const origError = console.error; + spyOn(console, 'error').and.callFake((message) => { + console.log(`console error message ${nonce} |||${message}|||`, new Error().stack); + if (/^\[Vue warn\]/.test(message)) { + console.log('we found a Vue warn!!!'); + //fail(message); + } else { + origError(message); + } + }); + /* */ +}); + // HACK: Chrome 59 disconnects if there are too many synchronous tests in a row // because it appears to lock up the thread that communicates to Karma's socket // This async beforeEach gets called on every spec and releases the JS thread long |