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
Closed

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

npiguet opened this issue Feb 26, 2015 · 1 comment

Comments

@npiguet
Copy link
Member

npiguet 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
…fined equal to null (same as everywhere else in ST-JS code)
@npiguet
Copy link
Member Author

npiguet commented Apr 21, 2015

fixed in master

@npiguet npiguet closed this as completed Apr 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant