Shouldjs Should.js Versions Save

BDD style assertions for node.js -- test framework agnostic

13.1.3

6 years ago

Fix #157

13.1.2

6 years ago

Revert in ts definition default export back to that was in 13.0.0

13.1.1

6 years ago

.rejecteWith in ts definition was missing return type

13.1.0

6 years ago

New

  1. Now all zero argument assertions throw TypeError in case any argument passed to them.
  2. Aliased .fulfill/.fulfilledWith to .resolve/.resolvedWith

Fixes

  1. TS definition fixed to allow such imports:
import should from 'should';

13.0.1

6 years ago

Add back missing umd build in root of package

13.0.0

6 years ago

Breaking changes

  1. Removed .enumerable, .enumerables (deprecated since 11.2.0)
  2. Fix for https://github.com/shouldjs/should.js/issues/150

New

Added Typescript bindings (still considering this as beta as i am TS newbie)

12.0.0

6 years ago

Map/Set/WeakMap/WeakSet equality checks

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.

Consistency in bundles

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:

  1. Browser bundle will not contain window.Should any more (with capital S). It was deprecated for the long time. Just use window.should as is.
  2. Node bundle change global.should to be should function instead of getter attached to Object.prototype.