diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-12 15:08:27 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-12 15:08:27 +0300 |
commit | e0d7577e29dcab90623e1f38cf11b351c665ee23 (patch) | |
tree | 5a34f26be66301f1af9e36b10a67dfca01fed8ec /spec/frontend/environment.js | |
parent | 60e7627c998b74d48df10b9a7759d6038a1f139c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/environment.js')
-rw-r--r-- | spec/frontend/environment.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/frontend/environment.js b/spec/frontend/environment.js index 7b160c48501..4e341b2bb2f 100644 --- a/spec/frontend/environment.js +++ b/spec/frontend/environment.js @@ -21,8 +21,17 @@ class CustomEnvironment extends TestEnvironment { // https://gitlab.com/gitlab-org/gitlab/-/merge_requests/39496#note_503084332 setGlobalDateToFakeDate(); + const { error: originalErrorFn } = context.console; Object.assign(context.console, { error(...args) { + if ( + args?.[0]?.includes('[Vue warn]: Missing required prop') || + args?.[0]?.includes('[Vue warn]: Invalid prop') + ) { + originalErrorFn.apply(context.console, args); + return; + } + throw new ErrorWithStack( `Unexpected call of console.error() with:\n\n${args.join(', ')}`, this.error, @@ -30,7 +39,7 @@ class CustomEnvironment extends TestEnvironment { }, warn(...args) { - if (args[0].includes('The updateQuery callback for fetchMore is deprecated')) { + if (args?.[0]?.includes('The updateQuery callback for fetchMore is deprecated')) { return; } throw new ErrorWithStack( |