Skip to content

Tape v4 incorrectly passes broken test data

There are tons of tests in Twing. Huzzah!

So it's not surprising that occasionally the wrong test data is put into our test. What is surprising is when Tape v4 compares 2 different values and passes them when using test.same().

For example in test/tests/unit/lib/extension/core/filters/merge/test.ts, this test passes:

test.same(await merge({foo: 'Foo'}, new Map([[0, 'b']])), new Map([[0, 'a'], [1, 'b']]));

Um… no. Map([['foo': 'Foo'], [0, 'b']) is not the same as Map([[0, 'a'], [1, 'b']]). Yes, they are both maps with 2 entries, but both the keys and the values are different. I don't understand how Tape v4 thinks they are the "same".

It turns out this is is a bug in Tape v4 that was fixed in v5. https://github.com/ljharb/tape/issues/495 TLDR; test.same() uses a "loose" equality, but is strict in v5.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information