-
Notifications
You must be signed in to change notification settings - Fork 121
Breaking changes
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.
Change in order of keys in formatted objects.
- Changes in package structure. You can break if you tried to call some specific files internally.
- All should modules now uses ^ as version specifier. Dropped node 0.6 support.
- 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
.
-
should-promised
merged to theshould
, that package now deprecated. - Browser build now uses
window.should
as a main function (previous not changed, but assume deprecated).
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.
-
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)
-
.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%. -
Format of inspections sligtly changed to be more consistent where possible and to look like browser dev tools format.
-
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.
- .containDeep* does not check substrings anymore.
- 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)
-
Nested errors messages changed. If you do not make any tests that uses messages for assertions you are ok.
-
Assertion#params#obj should be renamed to Assertion#params#actual (old one still accepted, but will be removed in 6.x)
- 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
- 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
.
-
.containDeep
now does not check for array order. For old behaviour use.containDeepOrdered
.