Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JUnit test driver: assertNotNull(undefined) is accepted #64

Closed
npiguet opened this issue Feb 26, 2015 · 1 comment

Comments

@npiguet
Copy link
Member

commented Feb 26, 2015

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.

npiguet added a commit that referenced this issue Apr 21, 2015

Fix issue #64: testhelper: assertNull and assertNotNull consider unde…
…fined equal to null (same as everywhere else in ST-JS code)
@npiguet

This comment has been minimized.

Copy link
Member Author

commented Apr 21, 2015

fixed in master

@npiguet npiguet closed this Apr 21, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.