https://github.com/mkizka/eslint-plugin-aaa
ESLint plugin to check Arrange-Act-Assert comments
https://github.com/mkizka/eslint-plugin-aaa
eslint testing
Last synced: 5 months ago
JSON representation
ESLint plugin to check Arrange-Act-Assert comments
- Host: GitHub
- URL: https://github.com/mkizka/eslint-plugin-aaa
- Owner: mkizka
- Created: 2024-08-17T11:08:41.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-18T10:16:33.000Z (almost 2 years ago)
- Last Synced: 2025-03-19T12:17:07.927Z (over 1 year ago)
- Topics: eslint, testing
- Language: TypeScript
- Homepage:
- Size: 78.1 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @mkizka/eslint-plugin-aaa
This ESLint plugin checks that `arrange`, `act`, and `assert` comments are present in test files.
```js
test("sample test", () => {
// arrange
setupSomething();
// act
const actual = testFunction();
// assert
expect(actual).toBe(expected);
});
```
## Installation
```
npm i -D @mkizka/eslint-plugin-aaa
```
## Example
```js
// eslint.config.js
import { arrangeActAssert } from "@mkizka/eslint-plugin-aaa";
export default [arrangeActAssert];
```
or
```js
// eslint.config.js
import { arrangeActAssertPlugin } from "@mkizka/eslint-plugin-aaa";
export default [
{
plugins: {
aaa: arrangeActAssertPlugin,
},
rules: {
"aaa/arrange-act-assert": "warn",
},
},
];
```