This repository was archived by the owner on Apr 8, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ const _tutorial: CR.Tutorial = {
1111 config : null ,
1212} ;
1313
14+ const configured = [ ] ;
15+
1416export default function tutorialReducer (
1517 t = _tutorial , action : Action
1618) : CR . Tutorial {
@@ -27,8 +29,11 @@ export default function tutorialReducer(
2729 const coderoadJsonPath = join ( packagePath , packageJson . main ) ;
2830 let { info, pages} = require ( coderoadJsonPath ) ;
2931
30- // configure test paths to absolute paths
31- pages = configPaths ( dir , name , config , pages || [ ] ) ;
32+ // configure test paths to absolute paths. Only once.
33+ if ( configured . indexOf ( name ) === - 1 ) {
34+ pages = configPaths ( dir , name , config , pages || [ ] ) ;
35+ }
36+ configured . push ( name ) ;
3237
3338 // return tutorial (info, pages) & tutorial package.json
3439 return {
Original file line number Diff line number Diff line change @@ -6,18 +6,22 @@ function configTestString(
66) : string {
77
88 if ( isWindows ) {
9+ // adjust paths for windows slashes
910 testPath = testPath . split ( '/' ) . join ( '\\' ) ;
1011 }
1112
13+ // adjust absolute file path
1214 if ( config . dir ) {
1315 testPath = join ( config . dir , testPath ) ;
1416 } else {
1517 testPath = join ( dir , 'node_modules' , name , testPath ) ;
1618 }
1719
1820 if ( config . testSuffix ) {
21+ // prevent repeat appending test suffix
1922 testPath += config . testSuffix ;
2023 }
24+
2125 return testPath ;
2226}
2327
You can’t perform that action at this time.
0 commit comments