diff --git a/docs/docs/config-yml.md b/docs/docs/config-yml.md index b968014a..fd5e2a88 100644 --- a/docs/docs/config-yml.md +++ b/docs/docs/config-yml.md @@ -38,15 +38,15 @@ config: tap: --reporter=mocha-tap-reporter ## The directory where to run the test runner from. If not specified, tests will run from the root of the project. Optional. directory: coderoad - ## Commits to load to setup the test runner. Optional. - setup: - ## A list of commands to run to configure the tutorial - commands: - - npm install ## App versions helps to ensure compatability with the Extension appVersions: ## Ensure compatability with a minimal VSCode CodeRoad version vscode: '>=0.7.0' + ## Setup commands + setup: + ## A list of commands to run to configure the tutorial + commands: + - npm install ## Repo information to load code from ## repo: diff --git a/docs/docs/errors.md b/docs/docs/errors.md index 45bb0f31..98d6dd98 100644 --- a/docs/docs/errors.md +++ b/docs/docs/errors.md @@ -9,4 +9,4 @@ Error loading commits: Callback must be a function ``` -If you get the above error when running `coderoad build`, check your node version with `node --version`. If it's less than version 12, try upgrading and run the command again. \ No newline at end of file +If you get the above error when running `coderoad build`, check your node version with `node --version`. If it's less than version 12, try upgrading and run the command again. diff --git a/docs/docs/examples.md b/docs/docs/examples.md index d9a530a4..107a40cd 100644 --- a/docs/docs/examples.md +++ b/docs/docs/examples.md @@ -6,5 +6,5 @@ sidebar_label: Examples Check out some of these tutorial repositories for reference: -- https://github.com/coderoad/fcc-learn-npm -- https://github.com/coderoad/fcc-basic-node-and-express +- +- diff --git a/docs/docs/yaml.md b/docs/docs/yaml.md index f433a831..48060320 100644 --- a/docs/docs/yaml.md +++ b/docs/docs/yaml.md @@ -70,15 +70,11 @@ config: tap: --reporter=mocha-tap-reporter ## The directory where to run the test runner from. If not specified, tests will run from the root of the project. Optional. directory: coderoad - ## Commits to load to setup the test runner. Optional. - ## - setup: - # - commit1 - # - commit2 - ## A list of commands to run to configure the tutorial - commands: - [] - # - npm install + ## Initial setup + ## + setup: + ## A list of commands to run to configure the tutorial + commands: [] ## App versions helps to ensure compatability with the Extension appVersions: ## Ensure compatability with a minimal VSCode CodeRoad version diff --git a/package.json b/package.json index 1953081c..0753a72b 100644 --- a/package.json +++ b/package.json @@ -34,14 +34,6 @@ "watch": "tsc -watch -p ./" }, "dependencies": { - "@types/assert": "^1.5.1", - "@types/jest": "^26.0.8", - "@types/jsdom": "^16.2.3", - "@types/node": "^14.0.27", - "@types/node-fetch": "^2.5.7", - "@types/semver": "^7.3.1", - "@typescript-eslint/eslint-plugin": "^3.7.1", - "@typescript-eslint/parser": "^3.7.1", "chokidar": "^3.4.1", "dotenv": "^8.2.0", "eslint": "^7.6.0", @@ -55,6 +47,14 @@ "vscode-extension-telemetry": "^0.1.6" }, "devDependencies": { + "@types/assert": "^1.5.1", + "@types/jest": "^26.0.8", + "@types/jsdom": "^16.2.3", + "@types/node": "^14.0.27", + "@types/node-fetch": "^2.5.7", + "@types/semver": "^7.3.1", + "@typescript-eslint/eslint-plugin": "^3.7.1", + "@typescript-eslint/parser": "^3.7.1", "eslint-config-prettier": "^6.11.0", "eslint-config-react-app": "^5.2.1", "eslint-plugin-flowtype": "^5.2.0", diff --git a/src/actions/index.ts b/src/actions/index.ts index e053e6e3..c3f65c74 100644 --- a/src/actions/index.ts +++ b/src/actions/index.ts @@ -4,5 +4,5 @@ export { default as onTutorialConfigContinue } from './onTutorialConfigContinue' export { default as onValidateSetup } from './onValidateSetup' export { default as onRunReset } from './onRunReset' export { default as onErrorPage } from './onErrorPage' -export { onRunTest, onTestPass } from './onTest' +export { runTest, onTestPass } from './onTest' export { onOpenLogs } from './onOpenLogs' diff --git a/src/actions/onTest.ts b/src/actions/onTest.ts index 77c13edc..51ade58d 100644 --- a/src/actions/onTest.ts +++ b/src/actions/onTest.ts @@ -9,6 +9,6 @@ export const onTestPass = (action: T.Action, context: Context): void => { git.saveCommit('Save progress') } -export const onRunTest = (action?: T.Action): void => { +export const runTest = (action?: T.Action): void => { vscode.commands.executeCommand(COMMANDS.RUN_TEST, action?.payload) } diff --git a/src/channel.ts b/src/channel.ts index f13e3c06..9b34d2fa 100644 --- a/src/channel.ts +++ b/src/channel.ts @@ -73,7 +73,7 @@ class Channel implements Channel { actions.onOpenLogs(action) return case 'EDITOR_RUN_TEST': - actions.onRunTest(action) + actions.runTest(action) return case 'EDITOR_RUN_RESET_LATEST': actions.onRunReset({ type: 'LATEST' }, this.context) diff --git a/src/services/hooks/index.ts b/src/services/hooks/index.ts index 263539af..d4345040 100644 --- a/src/services/hooks/index.ts +++ b/src/services/hooks/index.ts @@ -7,7 +7,7 @@ import openFiles from './utils/openFiles' import runCommands from './utils/runCommands' import runVSCodeCommands from './utils/runVSCodeCommands' import { onError as telemetryOnError } from '../telemetry' -import { onRunTest } from '../../actions/onTest' +import { runTest } from '../../actions/onTest' import logger from '../logger' export const onInit = async (actions: TT.StepActions): Promise => { @@ -35,7 +35,7 @@ export const onSolutionEnter = async (actions: TT.StepActions): Promise => await openFiles(actions?.files) await runCommands(actions?.commands) await runVSCodeCommands(actions?.vscodeCommands) - await onRunTest() + await runTest() } export const onReset = async (actions: TT.StepActions): Promise => { diff --git a/src/services/testRunner/index.ts b/src/services/testRunner/index.ts index ab2653f0..a9081673 100644 --- a/src/services/testRunner/index.ts +++ b/src/services/testRunner/index.ts @@ -63,7 +63,7 @@ const createTestRunner = (data: TT.Tutorial, callbacks: Callbacks): ((params: an // get tutorial step from position // check the step actions for specific command // NOTE: cannot just pass in step actions as the test can be called by: - // - onEditorSave, onWatcher, onSolution, onRunTest, onSubTask + // - onEditorSave, onWatcher, onSolution, runTest, onSubTask const levels = data.levels const level = levels.find((l) => l.id === position.levelId) const step = level?.steps.find((s) => s.id === position.stepId)