Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/real-geese-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'openzeppelin-solidity': patch
---

Add eslint-plugin-mocha, restrict async in describe blocks
7 changes: 7 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import js from '@eslint/js';
import { includeIgnoreFile } from '@eslint/compat';
import mocha from 'eslint-plugin-mocha';
import prettier from 'eslint-config-prettier';
import globals from 'globals';
import path from 'path';
Expand All @@ -10,6 +11,12 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
export default [
js.configs.recommended,
prettier,
{
plugins: { mocha },
rules: {
'mocha/no-async-suite': 'error',
},
},
{
languageOptions: {
ecmaVersion: 2022,
Expand Down
28 changes: 28 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"chai": "^4.2.0",
"eslint": "^9.0.0",
"eslint-config-prettier": "^10.0.0",
"eslint-plugin-mocha": "^11.2.0",
"ethers": "^6.16.0",
"glob": "^13.0.0",
"globals": "^17.0.0",
Expand Down
2 changes: 1 addition & 1 deletion test/access/manager/AccessManager.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ describe('AccessManager', function () {
expect(await this.manager.isTargetClosed(this.target)).to.be.false;
});

describe('when the target is the manager', async function () {
describe('when the target is the manager', function () {
it('closes and opens the manager', async function () {
await expect(this.manager.connect(this.admin).setTargetClosed(this.manager, true))
.to.emit(this.manager, 'TargetClosed')
Expand Down
2 changes: 1 addition & 1 deletion test/crosschain/BridgeERC1155.behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function shouldBehaveLikeBridgeERC1155({ chainAIsCustodial = false, chainBIsCust
]);
});

describe('crosschain send (both direction)', async function () {
describe('crosschain send (both direction)', function () {
it('single', async function () {
const [alice, bruce, chris] = this.accounts;

Expand Down
2 changes: 1 addition & 1 deletion test/token/ERC6909/ERC6909.behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function shouldBehaveLikeERC6909() {
await expect(this.token.balanceOf(this.recipient, firstTokenId)).to.eventually.equal(amount);
});

describe('with approval', async function () {
describe('with approval', function () {
beforeEach(async function () {
await this.token.connect(this.holder).approve(this.operator, firstTokenId, amount);
});
Expand Down