Skip to content
This repository has been archived by the owner on Nov 4, 2020. It is now read-only.

Breaking changes

Denis Bardadym edited this page Jan 29, 2017 · 11 revisions

Changes for 11.x

Alot of big internal changes. This can produce accidential breaking changes if test does not enough cover code. In assertions there is a one breaking change - .keys and .key. .keys now accepts object keys in form of rest arguments and .key change given object to object value for this key. Also .keys now do not check all properties exactly, use .only modifier for this.

Changes for 10.x

Change in order of keys in formatted objects.

Changes for 9.x

  1. Changes in package structure. You can break if you tried to call some specific files internally.
  2. All should modules now uses ^ as version specifier. Dropped node 0.6 support.
  3. Polished .eql config values. Now -0 and +0 assumed equal by default (if you need opposite set should.config.plusZeroAndMinusZeroEqual = false. Objects now checked for prototype equality. If you did something like this:
var a = { a: 10};
var F = function() { a = 10; };
var f = new F();
f.should.be.eql(a); // will throw from now

You should use .match for cases above. If you still need old behaviour set should.config.checkProtoEql = false.

Changes for 8.x

  1. should-promised merged to the should, that package now deprecated.
  2. Browser build now uses window.should as a main function (previous not changed, but assume deprecated).

Changes for 7.x

This release contains a lot of breaking changes. It could be good idea to do not migrate to it live code, but use it whenever you begin new project.

  1. No more getter assertions. No more false positives tests. No more complains of linters about unused expressions To update existing code you will need to add () everywhere where was getter used. Previous attempt results to fix the false positives were removed.
//was
a.should.be.true;
//now
a.should.be.true();

What does it mean 'false positive test':

a.should.be.string;

That assertions always passed as there is no .string getter and there is no way to check this (at least while Proxy not supported)

  1. .matchEach and .matchAny use internally .match now (and accept everything that .match accepts). While tests not failed, but i am not sure that they cover 100%.

  2. Format of inspections sligtly changed to be more consistent where possible and to look like browser dev tools format.

  3. should.type result changed to be an object with 3 properties: .type, .cls, .sub. Each of them, in order they are written, specify any type as much and distinct as possible.

Changes for 6.x

  1. .containDeep* does not check substrings anymore.

Changes for 5.x

  1. Old .eql implementation (that one used by node/iojs assert) and according should.config flag removed.

If you did some strange staff like comparing '19' and 19 use previous versions (or create Assertion#eql implementation that use old implementation - i do not think that i should spend time to allow users to shoot themselves in legs)

  1. Nested errors messages changed. If you do not make any tests that uses messages for assertions you are ok.

  2. Assertion#params#obj should be renamed to Assertion#params#actual (old one still accepted, but will be removed in 6.x)

Changes for 4.x

  1. Http and jq assertions moved to separate repositories. This repo only contains assertions for should.js core that works nice in both browser and node.js.

See organization repositories.

should-http now contain all http assertions, like:

  • .status(code)
  • .json
  • .header(name[, value])
  • .html
  1. Removed .include and .includeEql as it old, obsoleted and can be easy replaced with other assertions.

Generally you can replace .include and .includeEql with .containEql.

  1. .containDeep now does not check for array order. For old behaviour use .containDeepOrdered.