1

As Should.js use BDD style of assertions, it suppose to be readable from the code. I am wondering what is the most readable assert.fail() equivalent for should.js. I am missing something like should.fail.

luboskrnac
  • 23,973
  • 10
  • 81
  • 92

3 Answers3

2

should.fail exists as a method:

should.fail()
Myk Willis
  • 12,306
  • 4
  • 45
  • 62
  • Just tried it, such function without parameters doesn't exist, so it fails, but the message is confusing. – luboskrnac Oct 31 '14 at 20:10
  • Yeah, that's funny. Guess it's not documented (and doesn't work as I thought), yet it always did the trick for me just by blowing up the test. – Myk Willis Oct 31 '14 at 20:25
1

EDITED

How about:

  • "This should fail".should.be.true;
cybersam
  • 63,203
  • 6
  • 53
  • 76
0

So far I came up with:

false.should.be.true;

or

false.should.be.ok;
luboskrnac
  • 23,973
  • 10
  • 81
  • 92