File tree Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 28
28
, "mongodb-version-manager" : " ^0.5.0"
29
29
, "mongodb-tools" : " ~1.0"
30
30
, "co" : " 4.5.4"
31
+ , "bluebird" : " 2.9.27"
31
32
},
32
33
"author" : " Christian Kvalheim" ,
33
34
"license" : " Apache-2.0" ,
Original file line number Diff line number Diff line change
1
+ "use strict" ;
2
+
3
+ var f = require ( 'util' ) . format ;
4
+
5
+ exports [ 'Should Correctly Use Blurbird promises library' ] = {
6
+ metadata : {
7
+ requires : {
8
+ topology : [ 'single' , 'ssl' , 'wiredtiger' ]
9
+ }
10
+ } ,
11
+
12
+ // The actual test we wish to run
13
+ test : function ( configuration , test ) {
14
+ var MongoClient = configuration . require . MongoClient
15
+ , Promise = require ( 'bluebird' ) ;
16
+
17
+ MongoClient . connect ( configuration . url ( ) , {
18
+ promiseLibrary : Promise
19
+ } ) . then ( function ( db ) {
20
+ var promise = db . collection ( 'test' ) . insert ( { a :1 } ) ;
21
+ test . ok ( promise instanceof Promise ) ;
22
+
23
+ promise . then ( function ( ) {
24
+ db . close ( ) ;
25
+ test . done ( ) ;
26
+ } ) ;
27
+ } ) ;
28
+ }
29
+ }
Original file line number Diff line number Diff line change @@ -252,6 +252,7 @@ var testFiles =[
252
252
, '/test/functional/promises_collection_tests.js'
253
253
, '/test/functional/promises_cursor_tests.js'
254
254
, '/test/functional/operation_promises_example_tests.js'
255
+ , '/test/functional/byo_promises_tests.js'
255
256
256
257
// Logging tests
257
258
, '/test/functional/logger_tests.js'
You can’t perform that action at this time.
0 commit comments