@@ -3,7 +3,11 @@ import * as fs from "fs-extra";
33import * as yamlParser from "js-yaml" ;
44import { getArg } from "./utils/args" ;
55import gitP , { SimpleGit } from "simple-git/promise" ;
6- import { createCommandRunner , createCherryPick } from "./utils/exec" ;
6+ import {
7+ createCommandRunner ,
8+ createCherryPick ,
9+ createTestRunner ,
10+ } from "./utils/exec" ;
711import { getCommits , CommitLogObject } from "./utils/commits" ;
812
913async function validate ( args : string [ ] ) {
@@ -51,6 +55,7 @@ async function validate(args: string[]) {
5155 // no js cherry pick implementation
5256 const cherryPick = createCherryPick ( tmpDir ) ;
5357 const runCommands = createCommandRunner ( tmpDir ) ;
58+ const runTest = createTestRunner ( tmpDir , skeleton . config . testRunner ) ;
5459
5560 // VALIDATE TUTORIAL TESTS
5661
@@ -63,11 +68,15 @@ async function validate(args: string[]) {
6368 // run commands
6469 if ( skeleton . config ?. testRunner ?. setup ?. commands ) {
6570 console . info ( "Running setup commands..." ) ;
66- await runCommands ( skeleton . config ?. testRunner ?. setup ?. commands ) ;
71+
72+ await runCommands (
73+ skeleton . config ?. testRunner ?. setup ?. commands ,
74+ // add optional setup directory
75+ skeleton . config ?. testRunner ?. directory
76+ ) ;
6777 }
6878 }
6979
70- console . log ( skeleton . levels ) ;
7180 for ( const level of skeleton . levels ) {
7281 if ( level . setup ) {
7382 // load commits
@@ -84,6 +93,7 @@ async function validate(args: string[]) {
8493 // steps
8594 if ( level . steps ) {
8695 for ( const step of level . steps ) {
96+ console . log ( step ) ;
8797 // load commits
8898 if ( step . setup . commits ) {
8999 console . log ( `Loading ${ step . id } commits...` ) ;
@@ -94,6 +104,10 @@ async function validate(args: string[]) {
94104 console . log ( `Running ${ step . id } commands...` ) ;
95105 await runCommands ( step . setup . commands ) ;
96106 }
107+
108+ // run test
109+ console . info ( "Running test" ) ;
110+ await runTest ( ) ;
97111 }
98112 }
99113 }
0 commit comments