Skip to content
Snippets Groups Projects
Commit c1fac478 authored by Eric Eastwood's avatar Eric Eastwood
Browse files

Add Vue errorHandlor to remove rogue logged TypeErrors

parent 7fabc892
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -17,6 +17,12 @@ Vue.config.warnHandler = (msg, vm, trace) => {
fail(`${msg}${trace}`);
};
 
let hasVueErrors = false;
Vue.config.errorHandler = function (err) {
hasVueErrors = true;
fail(err);
};
Vue.use(VueResource);
 
// enable test fixtures
Loading
Loading
@@ -72,7 +78,7 @@ testsContext.keys().forEach(function (path) {
 
describe('test errors', () => {
beforeAll((done) => {
if (hasUnhandledPromiseRejections || hasVueWarnings) {
if (hasUnhandledPromiseRejections || hasVueWarnings || hasVueErrors) {
setTimeout(done, 1000);
} else {
done();
Loading
Loading
@@ -86,6 +92,10 @@ describe('test errors', () => {
it('has no Vue warnings', () => {
expect(hasVueWarnings).toBe(false);
});
it('has no Vue error', () => {
expect(hasVueErrors).toBe(false);
});
});
 
// if we're generating coverage reports, make sure to include all files so
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment