diff --git a/src/services/testRunner/index.ts b/src/services/testRunner/index.ts index af21447a..0133da3b 100644 --- a/src/services/testRunner/index.ts +++ b/src/services/testRunner/index.ts @@ -112,7 +112,7 @@ const createTestRunner = (data: TT.Tutorial, callbacks: Callbacks) => { summary: tap.summary, } - if (step.setup.subtasks) { + if (step.subtasks) { const subtaskSummary = parseSubtasks(tap.summary, position.stepId || '') callbacks.onFail(position, { diff --git a/typings/tutorial.d.ts b/typings/tutorial.d.ts index a6525e63..e43aa884 100644 --- a/typings/tutorial.d.ts +++ b/typings/tutorial.d.ts @@ -27,8 +27,8 @@ export type Step = { content: string setup: StepActions solution: Maybe - subtasks?: { [index: number]: boolean } hints?: string[] + subtasks?: string[] } /** A tutorial for use in VSCode CodeRoad */ @@ -52,7 +52,6 @@ export type StepActions = { files?: string[] watchers?: string[] filter?: string - subtasks?: string[] } export interface TestRunnerArgs { diff --git a/web-app/src/containers/Tutorial/components/Level.tsx b/web-app/src/containers/Tutorial/components/Level.tsx index 27ff8c77..bc738d6d 100644 --- a/web-app/src/containers/Tutorial/components/Level.tsx +++ b/web-app/src/containers/Tutorial/components/Level.tsx @@ -199,8 +199,8 @@ const Level = ({ return null } let subtasks = null - if (step?.setup?.subtasks) { - subtasks = step.setup.subtasks.map((subtask: string, subtaskIndex: number) => ({ + if (step?.subtasks) { + subtasks = step.subtasks.map((subtask: string, subtaskIndex: number) => ({ name: subtask, pass: !!(testStatus?.summary ? testStatus.summary[subtaskIndex] : false), })) diff --git a/web-app/src/services/state/actions/editor.ts b/web-app/src/services/state/actions/editor.ts index a1642933..da0c09e3 100644 --- a/web-app/src/services/state/actions/editor.ts +++ b/web-app/src/services/state/actions/editor.ts @@ -57,7 +57,7 @@ export default (editorSend: any) => ({ }, }) - if (step.setup.subtasks) { + if (step.subtasks) { // load subtask summary by running tests and parsing result editorSend({ type: 'EDITOR_RUN_TEST',