Skip to content

Commit 626bb7e

Browse files
committed
Fix tests for new parser stuff
1 parent 81dcc9f commit 626bb7e

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

node_modules/.package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "module",
66
"main": "issue-to-json.js",
77
"scripts": {
8-
"test": "echo \"Error: no test specified\" && exit 1"
8+
"test": "npm install ava && npx ava && npm uninstall ava"
99
},
1010
"keywords": [],
1111
"author": "",

test/sample-issue-template.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ body:
77
id: url
88
attributes:
99
label: Site URL
10-
description: The home page of the live web site you built
10+
description: The home page of the live web site you built [parser:url]
1111
placeholder: e.g. https://www.zachleat.com/
1212
validations:
1313
required: true
@@ -26,23 +26,23 @@ body:
2626
id: source_url
2727
attributes:
2828
label: Source code URL
29-
description: The URL for the source code for this site
29+
description: The URL for the source code for this site [parser:url]
3030
placeholder: e.g. https://github.com/zachleat/zachleat.com
3131
validations:
3232
required: false
3333
- type: textarea
3434
id: authors
3535
attributes:
3636
label: Authors (GitHub usernames)
37-
description: Leave this empty if you are the only author. If this has a value, make sure to include yourself in the list (if applicable!)
37+
description: Leave this empty if you are the only author. If this has a value, make sure to include yourself in the list (if applicable!) [parser:usernames]
3838
placeholder: e.g. @zachleat, @pdehaan
3939
validations:
4040
required: false
4141
- type: input
4242
id: business_url
4343
attributes:
4444
label: Super Professional Business Network CTA URL
45-
description: Open Collective Members can be featured on the [Eleventy Super Professional Business Network](https://www.11ty.dev/super-professional-business-network/)
45+
description: Open Collective Members can be featured on the [Eleventy Super Professional Business Network](https://www.11ty.dev/super-professional-business-network/) [parser:url]
4646
placeholder: e.g. https://www.zachleat.com/
4747
validations:
4848
required: false

test/test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ _No response_
4949
5050
### Authors (GitHub usernames)
5151
52-
_No response_
52+
@zachleat, pdehaan
5353
5454
### Super Professional Business Network CTA URL
5555
@@ -61,6 +61,8 @@ _No response_`;
6161

6262
let result = await parseIssueBody("./test/sample-issue-template.yml", body);
6363
t.is(result.url, "https://www.netlify.com/");
64+
t.is(result.leaderboard_excluded, true);
65+
t.deepEqual(result.authors, ["zachleat", "pdehaan"]);
6466
});
6567

6668
test("Cleanup usernames", async t => {

0 commit comments

Comments
 (0)