Fix a bad assumption in a test on Node 15+.

Review Request #13518 — Created Feb. 3, 2024 and submitted — Latest diff uploaded

Information

Spina
master

Reviewers

The unit test for anonymous classes failed on Node 15+. The test checks
that the anonymous wrapped class doesn't have a name attribute, since
it's anonymous. However, ES6 class spec says -- and Node 15+ mandates --
that these instead have a name of an empty string. This breaks our
assumption.

The assertion has been updated to check for either an empty name or a
missing attribute, covering all versions.

Unit tests pass on Node 14 through 21.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Fix a bad assumption in a test on Node 15+.
The unit test for anonymous classes failed on Node 15+. The test checks that the anonymous wrapped class doesn't have a `name` attribute, since it's anonymous. However, ES6 class spec says -- and Node 15+ mandates -- that these instead have a `name` of an empty string. This breaks our assumption. The assertion has been updated to check for either an empty name or a missing attribute, covering all versions.
095f556b8848f00c2f8006103b5ec137fc848b79 Christian Hammond
src/tests/spinaSubclassTests.ts
Loading...