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

Commit fac5fabf by Mick Hansen

fix: intermittent test failure

1 parent 3b656127
Showing with 15 additions and 4 deletions
......@@ -131,6 +131,7 @@ describe(Support.getTestDialectTeaser('HasMany'), function() {
return this.sequelize.sync({force: true}).then(function() {
return Promise.join(
User.create({
id: 1,
tasks: [
{title: 'b', subtasks: [
{title:'c'},
......@@ -152,6 +153,7 @@ describe(Support.getTestDialectTeaser('HasMany'), function() {
include: [{association: User.Tasks, include: [Task.SubTasks]}]
}),
User.create({
id: 2,
tasks: [
{title: 'a', subtasks: [
{title:'b'},
......@@ -171,16 +173,25 @@ describe(Support.getTestDialectTeaser('HasMany'), function() {
})
);
}).then(function(users) {
return User.findAll(
{
return User.findAll({
include: [{
association: User.Tasks,
limit: 2,
order: [['title', 'ASC']],
separate: true,
as: 'tasks',
include: [{association: Task.SubTasks, order: [['title', 'DESC']], separate: true, as: 'subtasks'}]
}]
include: [
{
association: Task.SubTasks,
order: [['title', 'DESC']],
separate: true,
as: 'subtasks'
}
]
}],
order: [
['id', 'ASC']
]
}).then(function(users) {
expect(users[0].tasks.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!