# async-test-assertions

Rule `sonarjs/async-test-assertions`. Async test assertions should be awaited or returned

- Source: sonarjs
- Technologies: JavaScript
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 6.2M weekly downloads of presets that enable it
- Trend: +62.1% last quarter
- Rank: #1168 by reach, #469 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `sonarjs/async-test-assertions` | yes | no | package `eslint-plugin-sonarjs` | [docs](https://rules.sonarsource.com/javascript/RSPEC-8780/) |

## Enable it

### ESLint: `eslint.config.js`

```js
export default [
  {
    rules: {
      "sonarjs/async-test-assertions": "error",
    },
  },
];
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [SonarJS recommended](https://lintradar.dev/presets/sonarjs-recommended.md) | ESLint | `eslint-plugin-sonarjs` | 230 | 6.2M | +62.1% |

## Related rules

- [sonarjs/assertions-in-tests](https://lintradar.dev/rules/sonarjs/assertions-in-tests.md): Tests should include assertions
- [sonarjs/avoid-mutating-nested-properties-of-shallow-clones](https://lintradar.dev/rules/sonarjs/avoid-mutating-nested-properties-of-shallow-clones.md): Nested properties of Lodash and Underscore.js clone results should not be mutated
- [sonarjs/assertions-in-test-cases](https://lintradar.dev/rules/sonarjs/assertions-in-test-cases.md): Assertions should be placed inside test cases or hooks
- [sonarjs/aws-apigateway-public-api](https://lintradar.dev/rules/sonarjs/aws-apigateway-public-api.md): AWS API Gateway should require authentication
- [sonarjs/array-callback-without-return](https://lintradar.dev/rules/sonarjs/array-callback-without-return.md): Callbacks of array methods should have return statements
- [sonarjs/aws-ec2-rds-dms-public](https://lintradar.dev/rules/sonarjs/aws-ec2-rds-dms-public.md): Public network access to cloud resources should be disabled

---

Web page: https://lintradar.dev/rules/sonarjs/async-test-assertions. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
