From 1ea8d73628e64b49326247ed049a7607facc195f Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Wed, 31 Mar 2021 22:21:36 +0200 Subject: [PATCH] LibJS: Provide 'details' key in results object for duplicate test The test-js program expects this to exist for 'result: "fail"' results and would crash if any duplicated test(message) occurs, as we didn't provide 'details' in that case. --- Userland/Libraries/LibJS/Tests/test-common.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Userland/Libraries/LibJS/Tests/test-common.js b/Userland/Libraries/LibJS/Tests/test-common.js index 4e6d0e62e09e49..eaf107d0ed9563 100644 --- a/Userland/Libraries/LibJS/Tests/test-common.js +++ b/Userland/Libraries/LibJS/Tests/test-common.js @@ -429,6 +429,7 @@ class ExpectationError extends Error { if (suite[message]) { suite[message] = { result: "fail", + details: "Another test with the same message did already run", }; return; }