-
-
Notifications
You must be signed in to change notification settings - Fork 100
BUG: Comparison between Symbol and number causes uncaught exception #251
Copy link
Copy link
Open
Description
A comparison between a Symbol and a number causes the following uncaught exception:
Cannot convert a Symbol value to a string
at direct (file:///home/mitsu/Dev/REDACTED/node_modules/uvu/diff/index.mjs:136:29)
at compare (file:///home/mitsu/Dev/REDACTED/node_modules/uvu/diff/index.mjs:218:9)
at assert (file:///home/mitsu/Dev/REDACTED/node_modules/uvu/assert/index.mjs:32:28)
at Module.equal (file:///home/mitsu/Dev/REDACTED/node_modules/uvu/assert/index.mjs:45:2)
at Object.handler (/home/mitsu/Dev/REDACTED/packages/REDACTED_PKG/tests/some.test.ts:118:10)
at Number.runner (file:///home/mitsu/Dev/REDACTED/node_modules/uvu/dist/index.mjs:78:16)
at async Timeout.exec [as _onTimeout] (file:///home/mitsu/Dev/REDACTED/node_modules/uvu/dist/index.mjs:141:33)
It doesn't appear to matter whether assert.is or assert.equal was used.
My proposed change would be to first compare the values using typeof (i.e. what assert.type does) and potentially give a failure result based on that.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels