summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Eastwood <contact@ericeastwood.com>2017-12-10 03:58:40 -0600
committerEric Eastwood <contact@ericeastwood.com>2017-12-10 03:58:44 -0600
commitc1fac478e08dcd1722a1bf501011fe3b7794a2c3 (patch)
tree6034bb6d3fbdffed11410ecdf1d09496e0120f97
parent7fabc892f251740dbd9a4755baede662e6854870 (diff)
downloadgitlab-ce-c1fac478e08dcd1722a1bf501011fe3b7794a2c3.tar.gz
Add Vue errorHandlor to remove rogue logged TypeErrors
See https://gitlab.com/gitlab-org/gitlab-ce/issues/37619#note_50422859
-rw-r--r--spec/javascripts/test_bundle.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/javascripts/test_bundle.js b/spec/javascripts/test_bundle.js
index fd7aa332d17..6897c991066 100644
--- a/spec/javascripts/test_bundle.js
+++ b/spec/javascripts/test_bundle.js
@@ -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