Skip to content

Commit

Permalink
test(require-author): add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfaith committed Feb 2, 2025
1 parent 81aecf0 commit 2138b7e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/tests/rules/require-author.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,23 @@ ruleTester.run("require-author", rules["require-author"], {
"name": "foo",
"version": "1.0.0"
}
`,
errors: [
{
data: { property: "author" },
line: 1,
messageId: "missing",
},
],
},
{
code: `{
"name": "foo",
"version": "1.0.0",
"bin": {
"author": "./cli.js"
}
}
`,
errors: [
{
Expand All @@ -31,5 +48,7 @@ ruleTester.run("require-author", rules["require-author"], {
valid: [
`{ "main": "./index.js", "author": "Sophie Trudeau" }`,
`{ "author": "Jessica Moss" }`,
`{ "author": 123 }`,
`{ "author": { "name": "Jessica Moss" } }`,
],
});

0 comments on commit 2138b7e

Please sign in to comment.