File tree Expand file tree Collapse file tree 3 files changed +4
-11
lines changed Expand file tree Collapse file tree 3 files changed +4
-11
lines changed Original file line number Diff line number Diff line change 11"use strict" ;
22var path_1 = require ( 'path' ) ;
3+ var isWindows = window . navigator . appVersion . indexOf ( 'Win' ) > - 1 ;
34var importPathRegex = / r e q u i r e \( [ " ' ] ( B A S E .+ ) [ " ' ] \) ( [ a - z A - Z 0 - 9 \- \_ ] + ) ? | ^ i m p o r t .+ ?\s ? [ " ' ] ( B A S E .+ ) [ " ' ] ; ? $ / m;
45var relativePathRegex = / ^ B A S E / ;
56function fixImportPaths ( _a ) {
6- var dir = _a . dir , content = _a . content , isWindows = _a . isWindows ;
7+ var dir = _a . dir , content = _a . content ;
78 var entries = new Set ( [ ] ) ;
89 return content . split ( '\n' ) . map ( function ( line ) {
910 var isMatch = line . match ( importPathRegex ) ;
Original file line number Diff line number Diff line change @@ -4,13 +4,14 @@ import { join } from 'path';
44 import paths won't match the context of the test runner
55 fixImportPaths will replace paths with absolute paths
66*/
7+ const isWindows = window . navigator . appVersion . indexOf ( 'Win' ) > - 1 ;
78
89// import or require statement
910const importPathRegex =
1011 / r e q u i r e \( [ " ' ] ( B A S E .+ ) [ " ' ] \) ( [ a - z A - Z 0 - 9 \- \_ ] + ) ? | ^ i m p o r t .+ ?\s ? [ " ' ] ( B A S E .+ ) [ " ' ] ; ? $ / m;
1112const relativePathRegex = / ^ B A S E / ;
1213
13- export default function fixImportPaths ( { dir, content, isWindows } ) : string {
14+ export default function fixImportPaths ( { dir, content} ) : string {
1415 // collect import lines
1516 let entries = new Set ( [ ] ) ;
1617
Original file line number Diff line number Diff line change 1818 "files" : [
1919 " src/importPaths.ts" ,
2020 " src/index.ts" ,
21- " src/system.ts" ,
22- " src/rewire-ts/__get__.ts" ,
23- " src/rewire-ts/addImportsAsVars.ts" ,
24- " src/rewire-ts/fileExists.ts" ,
25- " src/rewire-ts/getDefinePropertySrc.ts" ,
26- " src/rewire-ts/getImportGlobalsSrc.ts" ,
27- " src/rewire-ts/index.ts" ,
28- " src/rewire-ts/moduleEnv.ts" ,
29- " src/rewire-ts/rewire.ts" ,
3021 " src/typings/chai/chai.d.ts" ,
3122 " src/typings/cr/cr.d.ts" ,
3223 " src/typings/cr/globals.d.ts" ,
You can’t perform that action at this time.
0 commit comments