File tree Expand file tree Collapse file tree 4 files changed +22
-2
lines changed
Expand file tree Collapse file tree 4 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 66before_script :
77 - mysql -e 'create database orm_test;'
88 - psql -c 'create database orm_test;' -U postgres
9+ services :
10+ - mongodb
Original file line number Diff line number Diff line change 33 ORM_PROTOCOL=postgres node test/run
44 ORM_PROTOCOL=redshift node test/run
55 ORM_PROTOCOL=sqlite node test/run
6+ ORM_PROTOCOL=mongodb node test/run
67
78coverage : cov
89
Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ common.getConfig = function () {
2727 return { user : "postgres" , host : "localhost" , database : "orm_test" } ;
2828 case 'sqlite' :
2929 return { } ;
30+ case 'mongodb' :
31+ return { host : "localhost" , database : "test" } ;
3032 default :
3133 throw new Error ( "Unknown protocol" ) ;
3234 }
@@ -47,6 +49,8 @@ common.getConnectionString = function () {
4749 return 'postgres://postgres@localhost/orm_test' ;
4850 case 'sqlite' :
4951 return 'sqlite://' ;
52+ case 'mongodb' :
53+ return 'mongodb://localhost/test' ;
5054 default :
5155 throw new Error ( "Unknown protocol" ) ;
5256 }
Original file line number Diff line number Diff line change @@ -9,9 +9,11 @@ var mocha = new Mocha({
99runTests ( ) ;
1010
1111function runTests ( ) {
12- fs . readdirSync ( location ) . filter ( function ( file ) {
12+ fs . readdirSync ( location ) . filter ( function ( file ) {
1313 return file . substr ( - 3 ) === '.js' ;
14- } ) . forEach ( function ( file ) {
14+ } ) . forEach ( function ( file ) {
15+ if ( ! shouldRunTest ( file ) ) return ;
16+
1517 mocha . addFile (
1618 path . join ( location , file )
1719 ) ;
@@ -24,3 +26,14 @@ function runTests() {
2426 process . exit ( failures ) ;
2527 } ) ;
2628}
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