Automattic / expect.js

Minimalistic BDD-style assertions for Node.JS and the browser.
2.11k stars 209 forks source link

Expecting Null or Not Null Does Not Work #80

Closed calendee closed 10 years ago

calendee commented 10 years ago

I can't seem to write a proper test for "null".

Example : Either of the tests below should fail but do not, right?

var response = { 
    "status": "failed",
    "errorType": "vendor",
    "error": "Unroutable message - rejected",
    "messageCount": "1",
    "to": "5555551212",
    "from": "5555551212",
    "messageId": null,
    "msgPrice": null
}

expect( response.msgPrice).not.to.be(null);
expect( response.msgPrice).to.not.be(null);
calendee commented 10 years ago

Well, now I am getting my tests to work properly. I'm not sure why there was a problem to begin with . Consider this closed.