Promises work fine when there's just one test. With two tests however, the second test seems to get run before the async part of the first test has finished and the output intended for the first test ends up in the second. Both tests fail.
In more detail:
Question type: nodejs
Answer and Answer box preload:
const promising = () => {
return new Promise(response => {
setTimeout(() => {
console.log('Timed out');
}, 1000);
});
}
Test 1:
(async () => {
await promising();
})();
Expected output:
Timed out
Check gives:
so everything runs as expected.
Now after adding a second test Check gives:
Unchecking Is combinator just gives no output for either test (and no output for a single test either).
The obvious workaround is to have just one test per question, but that sort of defeats the purpose of having multiple tests.