@@ -78,14 +78,14 @@ async function validate(args: string[]) {
78
78
}
79
79
80
80
for ( const level of skeleton . levels ) {
81
- if ( level . setup ) {
81
+ if ( level ? .setup ) {
82
82
// load commits
83
83
if ( commits [ `${ level . id } ` ] ) {
84
84
console . log ( `Loading ${ level . id } commits...` ) ;
85
85
await cherryPick ( commits [ level . id ] ) ;
86
86
}
87
87
// run commands
88
- if ( level . setup . commands ) {
88
+ if ( level . setup ? .commands ) {
89
89
console . log ( `Running ${ level . id } commands...` ) ;
90
90
await runCommands ( level . setup . commands ) ;
91
91
}
@@ -105,14 +105,17 @@ async function validate(args: string[]) {
105
105
await runCommands ( step . setup . commands ) ;
106
106
}
107
107
108
- // ignore runnning tests on steps with no solution
109
- if ( step . solution ) {
108
+ const stepSolutionCommits = commits [ `${ step . id } A` ] ;
109
+ const hasSolution = step . solution || stepSolutionCommits ;
110
+
111
+ // ignore running tests on steps with no solution
112
+ if ( hasSolution ) {
110
113
// run test
111
- console . info ( "Running test" ) ;
114
+ console . info ( "Running setup test" ) ;
115
+ // expect fail
112
116
// await runTest();
113
117
}
114
118
115
- const stepSolutionCommits = commits [ `${ step . id } A` ] ;
116
119
if ( stepSolutionCommits ) {
117
120
console . info ( `Loading ${ step . id } solution commits...` ) ;
118
121
await cherryPick ( stepSolutionCommits ) ;
@@ -123,30 +126,24 @@ async function validate(args: string[]) {
123
126
console . info ( `Running ${ step . id } solution commands...` ) ;
124
127
await runCommands ( step . solution . commands ) ;
125
128
}
129
+
130
+ if ( hasSolution ) {
131
+ // run test
132
+ console . info ( "Running solution test" ) ;
133
+ // expect pass
134
+ // await runTest();
135
+ }
126
136
}
127
137
}
128
138
}
129
139
130
- // run test runner setup command(s)
131
- // loop over commits:
132
- // - load level commit
133
- // - run level setup command(s)
134
- // - load step setup commit(s)
135
- // - run step setup command(s)
136
- // - if next solution:
137
- // - run test - expect fail
138
- // - if solution
139
- // - run test - expect pass
140
-
141
140
// log level/step
142
141
// on error, show level/step & error message
143
-
144
- // load INIT commit(s)
145
142
} catch ( e ) {
146
143
console . error ( e . message ) ;
147
144
} finally {
148
145
// cleanup
149
- // await fs.emptyDir(tmpDir);
146
+ await fs . emptyDir ( tmpDir ) ;
150
147
}
151
148
}
152
149
0 commit comments