@@ -23,6 +23,8 @@ var collection = 'aggregate_' + random();
2323mongoose . model ( 'Aggregate' , userSchema ) ;
2424
2525describe ( 'model aggregate' , function ( ) {
26+ this . timeout ( process . env . TRAVIS ? 8000 : 4500 ) ;
27+
2628 var group = { $group : { _id : null , maxAge : { $max : '$age' } } } ;
2729 var project = { $project : { maxAge : 1 , _id : 0 } } ;
2830 var db , A , maxAge ;
@@ -74,8 +76,6 @@ describe('model aggregate', function() {
7476 } ) ;
7577
7678 it ( 'when return promise' , function ( done ) {
77- this . timeout ( 4000 ) ;
78-
7979 A . aggregate ( group , project ) . then ( function ( res ) {
8080 assert . ok ( res ) ;
8181 assert . equal ( 1 , res . length ) ;
@@ -86,8 +86,6 @@ describe('model aggregate', function() {
8686 } ) ;
8787
8888 it ( 'with arrays' , function ( done ) {
89- this . timeout ( 4000 ) ;
90-
9189 A . aggregate ( [ group , project ] , function ( err , res ) {
9290 assert . ifError ( err ) ;
9391 assert . ok ( res ) ;
@@ -99,8 +97,6 @@ describe('model aggregate', function() {
9997 } ) ;
10098
10199 it ( 'with Aggregate syntax' , function ( done ) {
102- this . timeout ( 4000 ) ;
103-
104100 var promise = A . aggregate ( )
105101 . group ( group . $group )
106102 . project ( project . $project )
@@ -116,8 +112,6 @@ describe('model aggregate', function() {
116112 } ) ;
117113
118114 it ( 'with Aggregate syntax if callback not provided' , function ( done ) {
119- this . timeout ( 4000 ) ;
120-
121115 var promise = A . aggregate ( )
122116 . group ( group . $group )
123117 . project ( project . $project )
@@ -143,8 +137,6 @@ describe('model aggregate', function() {
143137 return done ( ) ;
144138 }
145139
146- this . timeout ( 4000 ) ;
147-
148140 var outputCollection = 'aggregate_output_' + random ( ) ;
149141 A . aggregate ( )
150142 . group ( group . $group )
0 commit comments