js-must
js-must copied to clipboard
An assertion library for JavaScript and Node.js with a friendly BDD syntax (awesome.must.be.true()). It ships with many expressive matchers and is test runner and framework agnostic. Follows RFC 2119...
Example case: ``` js a = function () {} b = function () {} demand([a, b]).be.permutationOf([a, b]) // this passes demand([b, a]).be.permutationOf([a, b]) // this fails ``` The second assertion...
Using Must in Node.js 5.3, the following code: ``` js demand(Symbol("Hi there!")).be.undefined() ``` correctly throws, but the error message is highly confusing: > AssertionError: undefined must be undefined Seems like...
I am using the latest beta. This doesn't work: ``` javascript yield Promise.resolve(true).must.eventually.be.true() ``` It errors with: ``` Function.prototype.toString is not generic running chrome TypeError: Function.prototype.toString is not generic at...
Hello! Write tests on the button. When clicking on the button - it should be in focus, but due to the button for other reasons does not receive focus and...
Is there a specific reason you didn't want to use `deepEqual` or `deep.equal`? All the other assertions are pretty readable, but I constantly need to double-check `eql` or `equal`. Also,...
My assertion looks like this: ``` js myObject.myFunction.must.throw(/the text I expect/); ``` If myFunction throws a different exception (like `TypeError: Cannot read property 'myProperty' of null`) the must.js hides it...
Assume we have object: ``` js var obj = { a: 1, b: 2, c: 3, d: 4, e: 5, f: 6, foo: 27, bar: 28 } ``` We need...