luboskrnac
luboskrnac

Reputation: 24581

What is most readable way to do assert.fail() with should.js

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.

Upvotes: 1

Views: 244

Answers (3)

Myk Willis
Myk Willis

Reputation: 12879

should.fail exists as a method:

should.fail()

Upvotes: 2

cybersam
cybersam

Reputation: 67019

EDITED

How about:

  • "This should fail".should.be.true;

Upvotes: 1

luboskrnac
luboskrnac

Reputation: 24581

So far I came up with:

false.should.be.true;

or

false.should.be.ok;

Upvotes: 0

Related Questions