Add Vue errorHandlor to remove rogue logged TypeErrors

See https://gitlab.com/gitlab-org/gitlab-ce/issues/37619#note_50422859
This commit is contained in:
Eric Eastwood 2017-12-10 03:58:40 -06:00
parent 7fabc892f2
commit c1fac478e0

View file

@ -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
@ -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();
@ -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