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 testing something we can either use assertTrue(server.errors == 0) or assertEquals(server.errors, 0)
From a test perspective, there is no difference, when the test fails the way both of them are reported is different.
The former gives
org.arl.fjage.test.fjagejsTest > fjageJSTest FAILED
java.lang.AssertionError
at org.junit.Assert.fail(Assert.java:86)
...
whereas the latter prints out the values in the stack trace which are very useful when debugging errors (especially on CI where it's hard to get access to the HTML reports).
org.arl.fjage.test.fjagejsTest > fjageJSTest FAILED
java.lang.AssertionError: expected:<1> but was:<0>
at org.junit.Assert.fail(Assert.java:88)
Even better would be adding a string explanation of what the assert does assertEquals("ensure no errors were on the server after requesting to send 10 messages", server.errors, 0)
The text was updated successfully, but these errors were encountered:
When testing something we can either use
assertTrue(server.errors == 0)
orassertEquals(server.errors, 0)
From a test perspective, there is no difference, when the test fails the way both of them are reported is different.
The former gives
whereas the latter prints out the values in the stack trace which are very useful when debugging errors (especially on CI where it's hard to get access to the HTML reports).
Even better would be adding a string explanation of what the assert does
assertEquals("ensure no errors were on the server after requesting to send 10 messages", server.errors, 0)
The text was updated successfully, but these errors were encountered: