Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit514b2ad

Browse files
committed
prepare for test runner tests
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent6f1c7ff commit514b2ad

File tree

1 file changed

+17
-20
lines changed

1 file changed

+17
-20
lines changed

‎src/validate.ts

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ async function validate(args: string[]) {
7878
}
7979

8080
for(constlevelofskeleton.levels){
81-
if(level.setup){
81+
if(level?.setup){
8282
// load commits
8383
if(commits[`${level.id}`]){
8484
console.log(`Loading${level.id} commits...`);
8585
awaitcherryPick(commits[level.id]);
8686
}
8787
// run commands
88-
if(level.setup.commands){
88+
if(level.setup?.commands){
8989
console.log(`Running${level.id} commands...`);
9090
awaitrunCommands(level.setup.commands);
9191
}
@@ -105,14 +105,17 @@ async function validate(args: string[]) {
105105
awaitrunCommands(step.setup.commands);
106106
}
107107

108-
// ignore runnning tests on steps with no solution
109-
if(step.solution){
108+
conststepSolutionCommits=commits[`${step.id}A`];
109+
consthasSolution=step.solution||stepSolutionCommits;
110+
111+
// ignore running tests on steps with no solution
112+
if(hasSolution){
110113
// run test
111-
console.info("Running test");
114+
console.info("Running setup test");
115+
// expect fail
112116
// await runTest();
113117
}
114118

115-
conststepSolutionCommits=commits[`${step.id}A`];
116119
if(stepSolutionCommits){
117120
console.info(`Loading${step.id} solution commits...`);
118121
awaitcherryPick(stepSolutionCommits);
@@ -123,30 +126,24 @@ async function validate(args: string[]) {
123126
console.info(`Running${step.id} solution commands...`);
124127
awaitrunCommands(step.solution.commands);
125128
}
129+
130+
if(hasSolution){
131+
// run test
132+
console.info("Running solution test");
133+
// expect pass
134+
// await runTest();
135+
}
126136
}
127137
}
128138
}
129139

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-
141140
// log level/step
142141
// on error, show level/step & error message
143-
144-
// load INIT commit(s)
145142
}catch(e){
146143
console.error(e.message);
147144
}finally{
148145
// cleanup
149-
//await fs.emptyDir(tmpDir);
146+
awaitfs.emptyDir(tmpDir);
150147
}
151148
}
152149

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp