@@ -3,7 +3,11 @@ import * as fs from "fs-extra";
3
3
import * as yamlParser from "js-yaml" ;
4
4
import { getArg } from "./utils/args" ;
5
5
import 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" ;
7
11
import { getCommits , CommitLogObject } from "./utils/commits" ;
8
12
9
13
async function validate ( args : string [ ] ) {
@@ -51,6 +55,7 @@ async function validate(args: string[]) {
51
55
// no js cherry pick implementation
52
56
const cherryPick = createCherryPick ( tmpDir ) ;
53
57
const runCommands = createCommandRunner ( tmpDir ) ;
58
+ const runTest = createTestRunner ( tmpDir , skeleton . config . testRunner ) ;
54
59
55
60
// VALIDATE TUTORIAL TESTS
56
61
@@ -63,11 +68,15 @@ async function validate(args: string[]) {
63
68
// run commands
64
69
if ( skeleton . config ?. testRunner ?. setup ?. commands ) {
65
70
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
+ ) ;
67
77
}
68
78
}
69
79
70
- console . log ( skeleton . levels ) ;
71
80
for ( const level of skeleton . levels ) {
72
81
if ( level . setup ) {
73
82
// load commits
@@ -84,6 +93,7 @@ async function validate(args: string[]) {
84
93
// steps
85
94
if ( level . steps ) {
86
95
for ( const step of level . steps ) {
96
+ console . log ( step ) ;
87
97
// load commits
88
98
if ( step . setup . commits ) {
89
99
console . log ( `Loading ${ step . id } commits...` ) ;
@@ -94,6 +104,10 @@ async function validate(args: string[]) {
94
104
console . log ( `Running ${ step . id } commands...` ) ;
95
105
await runCommands ( step . setup . commands ) ;
96
106
}
107
+
108
+ // run test
109
+ console . info ( "Running test" ) ;
110
+ await runTest ( ) ;
97
111
}
98
112
}
99
113
}
0 commit comments