You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When writing ST-JS code, there is no distinction between undefined and null. However, when running unit tests, ST-JS implementation of assertNull() and assertNotNull() considers undefined to be different from null.
This seems to be because those assertions compare the actual value with null using the === operator. In JavaScript null === undefined is false, but null == undefined is true.
ST-JS should probably use the == version for these assertions to maintain consistency with the behavior of the rest of ST-JS.
As a workaround, assertNull(foo) can be replaced by assertTrue(foo == null) which performs as expected.
The text was updated successfully, but these errors were encountered:
When writing ST-JS code, there is no distinction between
undefined
andnull
. However, when running unit tests, ST-JS implementation ofassertNull()
andassertNotNull()
considersundefined
to be different fromnull
.This seems to be because those assertions compare the actual value with
null
using the===
operator. In JavaScriptnull === undefined
is false, butnull == undefined
is true.ST-JS should probably use the
==
version for these assertions to maintain consistency with the behavior of the rest of ST-JS.As a workaround,
assertNull(foo)
can be replaced byassertTrue(foo == null)
which performs as expected.The text was updated successfully, but these errors were encountered: