BDD style assertions for node.js -- test framework agnostic
Fix #157
Revert in ts definition default export back to that was in 13.0.0
.rejecteWith
in ts definition was missing return type
TypeError
in case any argument passed to them..fulfill
/.fulfilledWith
to .resolve
/.resolvedWith
import should from 'should';
Add back missing umd build in root of package
.enumerable
, .enumerables
(deprecated since 11.2.0)Added Typescript bindings (still considering this as beta as i am TS newbie)
User @BridgeAR pointed to a number of bugs and inconcistency in Map/Set/WeakMap/WeakSet checks. To fix all this things, i switched map and set equality checks to do key checks defined in standard instead of value checks. Typical example that was working before this release:
const m1 = new Map([[{ a: 1 }, 11]]);
const m2 = new Map([[{ a: 1 }, 11]]);
m1.should.be.eql(m2)
And not this example is breaking. At first view it is a bit unclear why it should not be so. Consider another example:
const m1 = new Map([[{}, 11], [{}, 12]]);
const m2 = new Map([[{}, 11], [{}, 12]]);
m1.should.be.eql(m2)
This example is not that clear if it should assert or not, right? (it should).
As Map and Set (as their weak equavalents) allows to use any type value/ref as key, perfectly equal by value (what should.js do) {} and {} is not equal by reference. In should.js i am always trying to limit users to do not shoot themselfs in their foots and just do right thing if possible and when possible. That is why both examples will throw assertions starting 12.0.0.
For the long time (probably several years now) browser bundle and node bundle has little differences in globals. To make them sync i am doing such changes to bundles:
window.Should
any more (with capital S). It was deprecated for the long time. Just use window.should
as is.global.should
to be should function instead of getter attached to Object.prototype
.