ccampbell / luna-testing

Simple, modern, opinionated JavaScript unit testing
https://craig.is/testing/code
MIT License
151 stars 6 forks source link

[BUG] All tests pass #11

Closed gabrigcl closed 3 years ago

gabrigcl commented 5 years ago

Hi!

It's weird, the assert function is behaving as if everything passed to it is evaluated as "true" and all tests pass even if it's falsy.

Ex:

export function testConcatRefPath(t) {
    t.assert(
        !!concatRefPath(
            firestore, 
            null, 
            ['toplevelcollection']
        ).doc, 
        'Path array parser: result should be a collection reference'
    );
}

After trying a lot discovering what was happening, I finally did these two tests:

export function testConcatRefPath(t) {
    t.assert(false);
    t.assert(true);
}

And yet it behave like everything passed is true. Hence, I think this is a bug that crashes the entire test tool. What do you say?

ccampbell commented 3 years ago

I believe this was fixed a long time ago in 31bca06901b711a8c4b30eea041d0208ebd2dffa, but I didn’t even realize there was a ticket open. Going to close this. Probably you have moved on to other testing libraries, but feel free to reopen if it is still an issue.