@@ -79,10 +79,19 @@ exports.Server = function Server(bsClient, workers) {
7979 framework_scripts = {
8080 'qunit' : [ 'qunit-plugin.js' ] ,
8181 'jasmine' : [ 'jasmine-jsreporter.js' , 'jasmine-plugin.js' ] ,
82+ 'jasmine2' : [ 'jasmine2-plugin.js' ] ,
8283 'mocha' : [ 'mocha-plugin.js' ]
8384 } ;
8485
85- if ( mimeType === 'text/html' ) {
86+ var filePath = path . relative ( process . cwd ( ) , filename ) ;
87+ var pathMatches ;
88+
89+ if ( typeof config . test_path === 'object' ) {
90+ pathMatches = ( config . test_path . indexOf ( filePath ) != - 1 ) ;
91+ } else {
92+ pathMatches = ( filePath == config . test_path ) ;
93+ }
94+ if ( pathMatches && mimeType === 'text/html' ) {
8695 var matcher = / ( .* ) < \/ h e a d > / ;
8796 var patch = "$1" ;
8897 scripts . forEach ( function ( script ) {
@@ -95,6 +104,10 @@ exports.Server = function Server(bsClient, workers) {
95104 patch += "<script type='text/javascript' src='/_patch/" + script + "'></script>\n" ;
96105 } ) ;
97106 patch += "<script type='text/javascript'>jasmine.getEnv().addReporter(new jasmine.JSReporter());</script>\n" ;
107+ } else if ( config [ 'test_framework' ] && config [ 'test_framework' ] == "jasmine2" ) {
108+ framework_scripts [ 'jasmine2' ] . forEach ( function ( script ) {
109+ patch += "<script type='text/javascript' src='/_patch/" + script + "'></script>\n" ;
110+ } ) ;
98111 } else if ( config [ 'test_framework' ] && config [ 'test_framework' ] == "mocha" ) {
99112 framework_scripts [ 'mocha' ] . forEach ( function ( script ) {
100113 patch += "<script type='text/javascript' src='/_patch/" + script + "'></script>\n" ;
0 commit comments