should.js encourages english-like assertions so that they're very easy to read.
i.e.
response.should.have.header('content-length')
obj.should.have.keys('foo', 'baz');
And so on. However, to assert that a variable "exists" (which is often more clear or practical than asserting ....should.not.equal(undefined)) you must break the english-like pattern by writing
should.exist(obj); There should be a way to write it like so: obj.should.exist()
should.js encourages english-like assertions so that they're very easy to read.
i.e.
response.should.have.header('content-length')
obj.should.have.keys('foo', 'baz');
And so on. However, to assert that a variable "exists" (which is often more clear or practical than asserting ...
.should.not.equal(undefined)
) you must break the english-like pattern by writingshould.exist(obj);
There should be a way to write it like so:obj.should.exist()