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

Commit 71fc3f84 by GongYi Committed by Sushant

Fix the unstable test "should work with two schema models in a hasMany association" (#6353)

The origin test rely on the record insert order which makes the result randomly
Fix the test
1 parent b4c8b4ca
Showing with 3 additions and 1 deletions
......@@ -389,6 +389,7 @@ if (current.dialect.supports.groupedLimit) {
return this.sequelize.sync({force: true}).then(() => {
return Promise.join(
User.create({
id:1,
tasks: [
{id: 1, title: 'b'},
{id: 2, title: 'd'},
......@@ -399,6 +400,7 @@ if (current.dialect.supports.groupedLimit) {
include: [User.Tasks]
}),
User.create({
id:2,
tasks: [
{id: 5, title: 'a'},
{id: 6, title: 'c'},
......@@ -410,7 +412,7 @@ if (current.dialect.supports.groupedLimit) {
);
}).then((users) => {
return User.findAll({
include: [{ model: Task, limit: 2, as: 'tasks' }],
include: [{ model: Task, limit: 2, as: 'tasks', order:[['id', 'ASC']] }],
order: [
['id', 'ASC']
],
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!