question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Assert.equal not returning properly

See original GitHub issue

Hi @DavertMik!

Since updating to v0.3.0 I am having problems with assert.equal when the assert fails:

Here a little code snippet to show what I mean:

Before((I) => {
I.amOnPage('/');
});

 Scenario.only(
   'Navigating to prev week check date picker value',
    function* prev(I, actionBarTop, appointmentPage) {
    assert.equal(true, false);
});
Navigation --
 Navigating to prev week check date picker value
 • I am on page "https://www.test.com"

and after that the test just finishes, without failing properly

On the otherhand with assert.equal(true, true) the tests passes

Is there some problem with assert?

UPDATE: I have got the impression that is has to do with your new handling of errors in the scenario.js: Line 22: recorder.add(() => done(err), true);

Might be the issue?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rezencommented, Jun 14, 2016

I’ve had similar symptoms with custom helpers. The when the test passes the message is OK, if it fails I get no feedback with errors.

0reactions
APshenkincommented, Jun 1, 2017

Tested in v0.6.3

Before((I, authPage) => {
   I.amOnPage(authPage.url);
});

Scenario.only('foo test', function*(I) {
    var bla = yield I.grabTextFrom('//button')
    assert.equal(bla, 'foo');
});


'Enter' == 'foo'
      + expected - actual

      -Enter
      +foo

Everything works as expected. Closing this issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Assert.equal not returning properly · Issue #89 - GitHub
Hi @DavertMik! Since updating to v0.3.0 I am having problems with assert.equal when the assert fails: Here a little code snippet to show ......
Read more >
junit - object java AssertEquals Same not returning true when ...
Assert.assertSame doc says: Asserts that two objects refer to the same object. Two objects can be equal ( object1.equals(obejct2) ) without being the...
Read more >
Mocha assertions not returning correctly on assert.equal with BN
@errata: I think that assert.equal just uses == , and since you're passing two different objects, it fails. You can verify my conjecture...
Read more >
Asserting Equality in your C# unit tests - Medium
AreEqual if you are using NUnit) will simply not state that they are equal. ... Assert.Equal(expected, actual); // The test will fail here....
Read more >
Best practices for writing unit tests - .NET - Microsoft Learn
Repeatable: Running a unit test should be consistent with its results, that is, it always returns the same result if you don't change...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found