@@ -5,13 +5,14 @@ import store from '../../store';
55
66export function tutorialConfig ( tutorialPj : PackageJson ) : Tutorial . Config {
77 const { config, name} = tutorialPj ;
8- const repo = loadRepo ( tutorialPj . repo ) ;
9- const dir = store . getState ( ) . dir ;
8+ const repo : string = loadRepo ( tutorialPj . repo ) ;
9+ const dir : string = store . getState ( ) . dir ;
10+ const testSuffix : string = config . testSuffix ;
1011 return {
11- dir : join (
12- dir , 'node_modules' , name , config . dir
13- ) ,
14- testSuffix : config . testSuffix || null ,
12+ dir : join ( dir , 'node_modules' , name , config . dir ) ,
13+ testSuffix : testSuffix . length && testSuffix [ 0 ] === '.'
14+ ? testSuffix
15+ : '.' + testSuffix || null ,
1516 runner : config . runner ,
1617 runnerOptions : config . runnerOptions || null ,
1718 run : loadRunner ( name , config . runner , dir ) ,
@@ -21,12 +22,7 @@ export function tutorialConfig(tutorialPj: PackageJson): Tutorial.Config {
2122 } ;
2223}
2324
24- // function getTestSuffix(suffix: string) {
25- // console.log(suffix);
26- // return suffix.substring(suffix.lastIndexOf('.') + 1, suffix.length);
27- // }
28-
29- function getIssuesPath ( bugs ?: { url : string } ) {
25+ function getIssuesPath ( bugs ?: { url : string } ) {
3026 return bugs && bugs . url ? bugs . url : null ;
3127}
3228
@@ -68,7 +64,7 @@ function loadRunner(name: string, runner: string, dir: string): () => any {
6864 }
6965}
7066
71- function loadRepo ( repo ?: { url : string } ) : string {
67+ function loadRepo ( repo ?: { url : string } ) : string {
7268 if ( repo && repo . url ) {
7369 let url : string = repo . url ;
7470 if ( ! ! url . match ( / \. g i t $ / ) ) {
0 commit comments