Skip to content

Commit 7da0e08

Browse files
committed
breaking - changes to testRunner.setup
Signed-off-by: shmck <[email protected]>
1 parent a0daa57 commit 7da0e08

File tree

8 files changed

+32
-35
lines changed

8 files changed

+32
-35
lines changed

Diff for: src/schema/skeleton.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ export default {
5252
description: "An optional folder for the test runner",
5353
examples: ["coderoad"],
5454
},
55-
setup: {
56-
$ref: "#/definitions/setup_action_without_commits",
57-
description:
58-
"Setup actions or commands used for setting up the test runner on tutorial launch",
59-
},
6055
},
6156
required: ["command", "args"],
6257
},
58+
setup: {
59+
$ref: "#/definitions/setup_action_without_commits",
60+
description:
61+
"Setup actions or commands used for setting up the test runner on tutorial launch",
62+
},
6363
repo: {
6464
type: "object",
6565
description: "The repo holding the git commits for the tutorial",

Diff for: src/schema/tutorial.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ export default {
7171
description: "An optional folder for the test runner",
7272
examples: ["coderoad"],
7373
},
74-
setup: {
75-
$ref: "#/definitions/setup_action",
76-
description:
77-
"Setup commits or commands used for setting up the test runner on tutorial launch",
78-
},
7974
},
8075
required: ["command", "args"],
8176
},
77+
setup: {
78+
$ref: "#/definitions/setup_action",
79+
description:
80+
"Setup commits or commands used for setting up the test runner on tutorial launch",
81+
},
8282
repo: {
8383
type: "object",
8484
description: "The repo holding the git commits for the tutorial",

Diff for: src/utils/parse.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ export function parse(params: ParseParams): any {
153153
// add init commits
154154
if (params.commits.INIT && params.commits.INIT.length) {
155155
// @ts-ignore
156-
parsed.config.testRunner.setup = {
157-
...(parsed.config?.testRunner?.setup || {}),
156+
parsed.config.setup = {
157+
...(parsed.config?.setup || {}),
158158
commits: params.commits.INIT,
159159
};
160160
}

Diff for: src/validate.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,10 @@ async function validate(args: string[]) {
7474
await cherryPick(commits.INIT);
7575

7676
// run commands
77-
if (skeleton.config?.testRunner?.setup?.commands) {
77+
if (skeleton.config?.setup?.commands) {
7878
console.info("-- Running commands...");
7979

80-
await runCommands(
81-
skeleton.config?.testRunner?.setup?.commands,
82-
// add optional setup directory
83-
skeleton.config?.testRunner?.directory
84-
);
80+
await runCommands(skeleton.config?.setup?.commands);
8581
}
8682
}
8783

Diff for: tests/parse.test.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -987,9 +987,9 @@ Description.
987987
tap: "--reporter=mocha-tap-reporter",
988988
},
989989
directory: "coderoad",
990-
setup: {
991-
commands: [],
992-
},
990+
},
991+
setup: {
992+
commands: [],
993993
},
994994
appVersions: {
995995
vscode: ">=0.7.0",
@@ -1026,9 +1026,9 @@ Description.
10261026
tap: "--reporter=mocha-tap-reporter",
10271027
},
10281028
directory: "coderoad",
1029-
setup: {
1030-
commands: [],
1031-
},
1029+
},
1030+
setup: {
1031+
commands: [],
10321032
},
10331033
repo: {
10341034
uri: "https://path.to/repo",
@@ -1101,9 +1101,9 @@ Description.
11011101
tap: "--reporter=mocha-tap-reporter",
11021102
},
11031103
directory: "coderoad",
1104-
setup: {
1105-
commits: ["abcdef1", "123456789"],
1106-
},
1104+
},
1105+
setup: {
1106+
commits: ["abcdef1", "123456789"],
11071107
},
11081108
repo: {
11091109
uri: "https://path.to/repo",

Diff for: tests/skeleton.test.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@ const validJson = {
88
config: {
99
testRunner: {
1010
directory: "coderoad",
11-
setup: {
12-
commands: [],
13-
},
11+
1412
args: {
1513
filter: "--grep",
1614
tap: "--reporter=mocha-tap-reporter",
1715
},
1816
command: "./node_modules/.bin/mocha",
1917
},
18+
setup: {
19+
commands: [],
20+
},
2021
repo: {
2122
uri: "http://github.com/somePath/toRepo.git",
2223
branch: "codeBranch",

Diff for: tests/tutorial.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ const validJson: Partial<T.Tutorial> = {
1313
tap: "tap",
1414
},
1515
directory: "coderoad",
16-
setup: {
17-
commits: ["abcdef1"],
18-
commands: ["npm install"],
19-
},
16+
},
17+
setup: {
18+
commits: ["abcdef1"],
19+
commands: ["npm install"],
2020
},
2121
repo: {
2222
uri: "https://github.com/some-repo.git",

Diff for: typings/tutorial.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export type TutorialConfig = {
1010
repo: TutorialRepo;
1111
dependencies?: TutorialDependency[];
1212
reset?: ConfigReset;
13+
setup?: StepActions;
1314
};
1415

1516
/** Logical groupings of tasks */
@@ -69,7 +70,6 @@ export interface TestRunnerConfig {
6970
command: string;
7071
args: TestRunnerArgs;
7172
directory?: string;
72-
setup?: StepActions;
7373
}
7474

7575
export interface TutorialRepo {

0 commit comments

Comments
 (0)