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

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