File tree 4 files changed +22
-2
lines changed
4 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 6
6
before_script :
7
7
- mysql -e 'create database orm_test;'
8
8
- psql -c 'create database orm_test;' -U postgres
9
+ services :
10
+ - mongodb
Original file line number Diff line number Diff line change 3
3
ORM_PROTOCOL=postgres node test/run
4
4
ORM_PROTOCOL=redshift node test/run
5
5
ORM_PROTOCOL=sqlite node test/run
6
+ ORM_PROTOCOL=mongodb node test/run
6
7
7
8
coverage : cov
8
9
Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ common.getConfig = function () {
27
27
return { user : "postgres" , host : "localhost" , database : "orm_test" } ;
28
28
case 'sqlite' :
29
29
return { } ;
30
+ case 'mongodb' :
31
+ return { host : "localhost" , database : "test" } ;
30
32
default :
31
33
throw new Error ( "Unknown protocol" ) ;
32
34
}
@@ -47,6 +49,8 @@ common.getConnectionString = function () {
47
49
return 'postgres://postgres@localhost/orm_test' ;
48
50
case 'sqlite' :
49
51
return 'sqlite://' ;
52
+ case 'mongodb' :
53
+ return 'mongodb://localhost/test' ;
50
54
default :
51
55
throw new Error ( "Unknown protocol" ) ;
52
56
}
Original file line number Diff line number Diff line change @@ -9,9 +9,11 @@ var mocha = new Mocha({
9
9
runTests ( ) ;
10
10
11
11
function runTests ( ) {
12
- fs . readdirSync ( location ) . filter ( function ( file ) {
12
+ fs . readdirSync ( location ) . filter ( function ( file ) {
13
13
return file . substr ( - 3 ) === '.js' ;
14
- } ) . forEach ( function ( file ) {
14
+ } ) . forEach ( function ( file ) {
15
+ if ( ! shouldRunTest ( file ) ) return ;
16
+
15
17
mocha . addFile (
16
18
path . join ( location , file )
17
19
) ;
@@ -24,3 +26,14 @@ function runTests() {
24
26
process . exit ( failures ) ;
25
27
} ) ;
26
28
}
29
+
30
+ function shouldRunTest ( file ) {
31
+ var name = file . substr ( 0 , file . length - 3 ) ;
32
+ var proto = process . env . ORM_PROTOCOL ;
33
+
34
+ if ( proto == "mongodb" && [ "association-hasmany-extra" , "association-hasmany" ,
35
+ "model-aggregate" ,
36
+ "property-lazyload" , "property-number-size" ] . indexOf ( name ) >= 0 ) return false ;
37
+
38
+ return true ;
39
+ }
You can’t perform that action at this time.
0 commit comments