Skip to content

test config #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/templates/coderoad.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ config:
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'
## App versions helps to ensure compatability with the Extension
appVersions:
{}
## Ensure compatability with a minimal VSCode CodeRoad version
# vscode: '>=0.7.0'
## Repo information to load code from
##
repo:
Expand Down
62 changes: 62 additions & 0 deletions tests/parse.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,66 @@ levels:
expect(result.summary.description).toBe(expected.summary.description);
expect(result.levels[0].content).toBe(expected.levels[0].content);
});

it("should parse the tutorial config", () => {
const md = `# Title

Description.
`;
const yaml = `
config:
testRunner:
command: ./node_modules/.bin/mocha
args:
filter: --grep
tap: --reporter=mocha-tap-reporter
directory: coderoad
setup:
commits:
- abcdefg1
commands: []
appVersions:
vscode: '>=0.7.0'
repo:
uri: https://path.to/repo
branch: aBranch
dependencies:
- name: node
version: '>=10'
`;
const result = parse(md, yaml);
const expected = {
summary: {
description: "Description.\n\nSecond description line",
},
config: {
testRunner: {
command: "./node_modules/.bin/mocha",
args: {
filter: "--grep",
tap: "--reporter=mocha-tap-reporter",
},
directory: "coderoad",
setup: {
commits: ["abcdefg1"],
commands: [],
},
},
repo: {
uri: "https://path.to/repo",
branch: "aBranch",
},
dependencies: [
{
name: "node",
version: ">=10",
},
],
appVersions: {
vscode: ">=0.7.0",
},
},
};
expect(result.config).toEqual(expected.config);
});
});