0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Bump should to version 13.1.3 (#9284)

refs https://github.com/TryGhost/Ghost/issues/9178

- adapt major changes
- see https://github.com/shouldjs/should.js/blob/master/History.md
- should.have.enumerable was removed
This commit is contained in:
Katharina Irrgang 2017-11-28 19:41:16 +01:00 committed by GitHub
parent b4b5da2a75
commit b9a44bacf6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 36 additions and 33 deletions

View file

@ -81,7 +81,7 @@ describe('Tags API', function () {
.then(function () {
done(new Error('Adding a tag with an invalid name is not rejected.'));
}).catch(function (errors) {
errors.should.have.enumerable(0).with.property('errorType', 'ValidationError');
errors[0].errorType.should.eql('ValidationError');
done();
}).catch(done);
});
@ -127,7 +127,7 @@ describe('Tags API', function () {
.then(function () {
done(new Error('Adding a tag with an invalid name is not rejected.'));
}).catch(function (errors) {
errors.should.have.enumerable(0).with.property('errorType', 'ValidationError');
errors[0].errorType.should.eql('ValidationError');
done();
}).catch(done);
});

View file

@ -1738,18 +1738,20 @@ describe('Post Model', function () {
// creates a test tag
should.exist(tagJSON);
tagJSON.should.be.an.Array().with.lengthOf(3);
tagJSON.should.have.enumerable(0).with.property('name', 'existing tag a');
tagJSON.should.have.enumerable(1).with.property('name', 'existing-tag-b');
tagJSON.should.have.enumerable(2).with.property('name', 'existing_tag_c');
tagJSON[0].name.should.eql('existing tag a');
tagJSON[1].name.should.eql('existing-tag-b');
tagJSON[2].name.should.eql('existing_tag_c');
// creates a test post with an array of tags in the correct order
should.exist(postJSON);
postJSON.title.should.eql('HTML Ipsum');
should.exist(postJSON.tags);
postJSON.tags.should.be.an.Array().and.have.lengthOf(3);
postJSON.tags.should.have.enumerable(0).with.property('name', 'tag1');
postJSON.tags.should.have.enumerable(1).with.property('name', 'tag2');
postJSON.tags.should.have.enumerable(2).with.property('name', 'tag3');
postJSON.tags[0].name.should.eql('tag1');
postJSON.tags[1].name.should.eql('tag2');
postJSON.tags[2].name.should.eql('tag3');
done();
});
@ -1765,11 +1767,9 @@ describe('Post Model', function () {
updatedPost = updatedPost.toJSON({include: ['tags']});
updatedPost.tags.should.have.lengthOf(1);
updatedPost.tags.should.have.enumerable(0).with.properties({
name: postJSON.tags[0].name,
slug: 'eins',
id: postJSON.tags[0].id
});
updatedPost.tags[0].name.should.eql(postJSON.tags[0].name);
updatedPost.tags[0].slug.should.eql('eins');
updatedPost.tags[0].id.should.eql(postJSON.tags[0].id);
});
});
@ -1795,7 +1795,7 @@ describe('Post Model', function () {
updatedPost = updatedPost.toJSON({include: ['tags']});
updatedPost.tags.should.have.lengthOf(1);
updatedPost.tags.should.have.enumerable(0).with.properties({
updatedPost.tags[0].should.have.properties({
name: postJSON.tags[0].name,
slug: 'eins',
id: postJSON.tags[0].id,
@ -1825,14 +1825,16 @@ describe('Post Model', function () {
updatedPost = updatedPost.toJSON({include: ['tags']});
updatedPost.tags.should.have.lengthOf(3);
updatedPost.tags.should.have.enumerable(0).with.properties({
updatedPost.tags[0].should.have.properties({
name: 'tag4'
});
updatedPost.tags.should.have.enumerable(1).with.properties({
updatedPost.tags[1].should.have.properties({
name: 'tag3',
id: postJSON.tags[2].id
});
updatedPost.tags.should.have.enumerable(2).with.properties({
updatedPost.tags[2].should.have.properties({
name: 'tag1',
id: postJSON.tags[0].id
});
@ -1853,9 +1855,10 @@ describe('Post Model', function () {
updatedPost = updatedPost.toJSON({include: ['tags']});
updatedPost.tags.should.have.lengthOf(3);
updatedPost.tags.should.have.enumerable(0).with.properties({name: 'C', slug: 'c'});
updatedPost.tags.should.have.enumerable(1).with.properties({name: 'C++', slug: 'c-2'});
updatedPost.tags.should.have.enumerable(2).with.properties({name: 'C#', slug: 'c-3'});
updatedPost.tags[0].should.have.properties({name: 'C', slug: 'c'});
updatedPost.tags[1].should.have.properties({name: 'C++', slug: 'c-2'});
updatedPost.tags[2].should.have.properties({name: 'C#', slug: 'c-3'});
});
});

View file

@ -220,7 +220,7 @@ describe('API Utils', function () {
errors = apiUtils.validateOptions(options);
errors.should.be.an.Array().and.have.lengthOf(1);
errors.should.have.enumerable('0').with.property('errorType', 'ValidationError');
errors[0].errorType.should.eql('ValidationError');
});
}

View file

@ -122,7 +122,7 @@
"nock": "9.1.3",
"rewire": "2.5.2",
"run-sequence": "1.2.2",
"should": "11.2.1",
"should": "13.1.3",
"should-http": "0.1.1",
"sinon": "4.1.2",
"supertest": "3.0.0",

View file

@ -5149,13 +5149,13 @@ shebang-regex@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
should-equal@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/should-equal/-/should-equal-1.0.1.tgz#0b6e9516f2601a9fb0bb2dcc369afa1c7e200af7"
should-equal@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/should-equal/-/should-equal-2.0.0.tgz#6072cf83047360867e68e98b09d71143d04ee0c3"
dependencies:
should-type "^1.0.0"
should-type "^1.4.0"
should-format@^3.0.2:
should-format@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/should-format/-/should-format-3.0.3.tgz#9bfc8f74fa39205c53d38c34d717303e277124f1"
dependencies:
@ -5175,7 +5175,7 @@ should-type-adaptors@^1.0.1:
should-type "^1.3.0"
should-util "^1.0.0"
should-type@^1.0.0, should-type@^1.3.0, should-type@^1.4.0:
should-type@^1.3.0, should-type@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/should-type/-/should-type-1.4.0.tgz#0756d8ce846dfd09843a6947719dfa0d4cff5cf3"
@ -5183,12 +5183,12 @@ should-util@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/should-util/-/should-util-1.0.0.tgz#c98cda374aa6b190df8ba87c9889c2b4db620063"
should@11.2.1:
version "11.2.1"
resolved "https://registry.yarnpkg.com/should/-/should-11.2.1.tgz#90f55145552d01cfc200666e4e818a1c9670eda2"
should@13.1.3:
version "13.1.3"
resolved "https://registry.yarnpkg.com/should/-/should-13.1.3.tgz#a089bdf7979392a8272a712c8b63acbaafb7948f"
dependencies:
should-equal "^1.0.0"
should-format "^3.0.2"
should-equal "^2.0.0"
should-format "^3.0.3"
should-type "^1.4.0"
should-type-adaptors "^1.0.1"
should-util "^1.0.0"