An open API service indexing awesome lists of open source software.

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

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",
},
},
];
```