mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-30 16:01:14 -04:00
refactor: clearer errors for curriculum tests (#62331)
This commit is contained in:
committed by
GitHub
parent
bbe7752ef1
commit
d96d528e8c
@@ -329,7 +329,11 @@ seed goes here
|
||||
it(
|
||||
`Solution ${index + 1} must pass the tests`,
|
||||
async function () {
|
||||
await testRunner(tests);
|
||||
try {
|
||||
await testRunner(tests);
|
||||
} catch (e) {
|
||||
expect(e).toBeUndefined();
|
||||
}
|
||||
},
|
||||
timePerTest * tests.length + 2000
|
||||
);
|
||||
@@ -385,12 +389,8 @@ async function createTestRunner(
|
||||
const newMessage = solutionFromNext
|
||||
? 'Check next step for solution!\n' + text
|
||||
: text;
|
||||
// if the stack is missing, the message should be included. Otherwise it
|
||||
// is redundant.
|
||||
err.message = err.stack
|
||||
? newMessage
|
||||
: `${newMessage}
|
||||
${err.message}`;
|
||||
err.message = `${newMessage}
|
||||
Original message: ${err.message}`;
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user