-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: use vitest as test runner for eslint-plugin-supa-mdx too
- Loading branch information
Showing
5 changed files
with
122 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
packages/eslint-supa-mdx/tests/rule001_heading_case.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { describe, expect, it } from "vitest"; | ||
|
||
import { ruleTester } from "./utils.js"; | ||
import rule001 from "../rules/rule001_heading_case.js"; | ||
|
||
describe("Rule001HeadingCase", () => { | ||
it("should enforce sentence case headings", () => { | ||
const test = () => { | ||
ruleTester.run("Rule001HeadingCase", rule001, { | ||
valid: [ | ||
{ | ||
code: "# Sentence case heading", | ||
}, | ||
], | ||
invalid: [ | ||
{ | ||
code: "# all lowercase heading", | ||
errors: [ | ||
{ | ||
message: "Heading should be sentence case", | ||
}, | ||
], | ||
}, | ||
{ | ||
code: "# Title Case Heading", | ||
errors: [ | ||
{ | ||
message: "Heading should be sentence case", | ||
}, | ||
], | ||
}, | ||
], | ||
}); | ||
}; | ||
|
||
expect(test).not.toThrow(); | ||
}); | ||
}); |