'Add extra information
I have massively simplified this code, but the idea is that it generates a random number, does an action then tests the response was the same random number generated. I would like to show the random number generated in the console output.
I have mocked out the other functions to keep this concise; so ignore the fact the test will always pass, its the formatting of the output that concerns me.
it(`Test Random`, async function () {
const rndNftId = randBetween(1, 10);
expect(rndNftId).to.equal(rndNftId);
});
This test passes, but I want the output something like;
✔ Test Random (RND was 19191)
Instead of
✔ Test Random
I just want a way to add other information to the console output, if I use console.log it doesn't indent or format it alongside the test.
So right now, it passes
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
