File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ var mimeTypes = {
23
23
24
24
exports . Server = function Server ( bsClient , workers ) {
25
25
26
+ var testFilePaths = ( Array . isArray ( config . test_path ) ? config . test_path : [ config . test_path ] )
27
+ . map ( function ( path ) {
28
+ return path . split ( / [ ? # ] / ) [ 0 ] ;
29
+ } ) ;
30
+
26
31
function handleFile ( filename , request , response , doNotUseProxy ) {
27
32
var url_parts = url . parse ( request . url , true ) ;
28
33
var query = url_parts . query ;
@@ -46,13 +51,7 @@ exports.Server = function Server(bsClient, workers) {
46
51
} ;
47
52
48
53
var filePath = path . relative ( process . cwd ( ) , filename ) ;
49
- var pathMatches ;
50
-
51
- if ( typeof config . test_path === 'object' ) {
52
- pathMatches = ( config . test_path . indexOf ( filePath ) !== - 1 ) ;
53
- } else {
54
- pathMatches = ( filePath === config . test_path ) ;
55
- }
54
+ var pathMatches = ( testFilePaths . indexOf ( filePath ) !== - 1 ) ;
56
55
57
56
if ( pathMatches && mimeType === 'text/html' ) {
58
57
var framework = config [ 'test_framework' ] ;
You can’t perform that action at this time.
0 commit comments