]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
test: improve unexpected warning output
authorEvan You <yyx990803@gmail.com>
Tue, 28 Jul 2020 04:24:12 +0000 (00:24 -0400)
committerEvan You <yyx990803@gmail.com>
Tue, 28 Jul 2020 14:40:25 +0000 (10:40 -0400)
scripts/setupJestEnv.ts

index 95f126152dd1a0885120303593836440bbbec4be..381a404f76ffa992b290b0a7d97258b76a3fad9d 100644 (file)
@@ -80,9 +80,10 @@ afterEach(() => {
     })
   warn.mockRestore()
   if (nonAssertedWarnings.length) {
-    nonAssertedWarnings.forEach(warning => {
-      console.warn(warning)
-    })
-    throw new Error(`test case threw unexpected warnings.`)
+    throw new Error(
+      `test case threw unexpected warnings:\n - ${nonAssertedWarnings.join(
+        '\n - '
+      )}`
+    )
   }
 })