不要怂,就是干,撸起袖子干!

Commit 9430706b by Jan Aagaard Meier

Changed a couple of assertions to use chai as promised

1 parent 3e5943dd
Showing with 5 additions and 12 deletions
...@@ -971,32 +971,25 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () { ...@@ -971,32 +971,25 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
]) ])
}).then(function () { }).then(function () {
return Promise.all([ return Promise.all([
this.Tag.find({ expect(this.Tag.find({
where: { where: {
id: this.tags[0].id id: this.tags[0].id
}, },
include: [ include: [
{model: this.Product, as: 'products'} {model: this.Product, as: 'products'}
] ]
}), })).to.eventually.have.property('products').to.have.length(2),
this.Product.find({ expect(this.Product.find({
where: { where: {
id: this.products[0].id id: this.products[0].id
}, },
include: [ include: [
{model: this.Tag, as: 'tags'} {model: this.Tag, as: 'tags'}
] ]
}), })).to.eventually.have.property('tags').to.have.length(2),
expect(this.tags[1].getProducts()).to.eventually.have.length(3), expect(this.tags[1].getProducts()).to.eventually.have.length(3),
expect(this.products[1].getTags()).to.eventually.have.length(1), expect(this.products[1].getTags()).to.eventually.have.length(1),
]) ]);
}).spread(function (tag, product) {
expect(tag).to.exist;
expect(tag.products.length).to.equal(2);
expect(product).to.exist;
expect(product.tags.length).to.equal(2);
}); });
}) })
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!