From 78d4e300b976023c92497ac3b463276467f537fa Mon Sep 17 00:00:00 2001 From: Matt Venables Date: Thu, 15 Sep 2022 10:35:22 -0400 Subject: [PATCH] Enable testing from VSCode Per the [Hardhat docs](https://hardhat.org/hardhat-runner/docs/advanced/vscode-tests) --- .mocharc.json | 5 +++++ .vscode/extensions.json | 5 ++++- package-lock.json | 1 + package.json | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .mocharc.json diff --git a/.mocharc.json b/.mocharc.json new file mode 100644 index 00000000..c2acc636 --- /dev/null +++ b/.mocharc.json @@ -0,0 +1,5 @@ +{ + "require": "hardhat/register", + "timeout": 40000, + "_": ["test/**/*.ts"] +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 7d5d7da3..136d7571 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,3 +1,6 @@ { - "recommendations": ["NomicFoundation.hardhat-solidity"] + "recommendations": [ + "NomicFoundation.hardhat-solidity", + "hbenl.vscode-mocha-test-adapter" + ] } diff --git a/package-lock.json b/package-lock.json index 08278d44..a6f29eb5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "eslint": "^8.23.0", "eslint-config-prettier": "^8.5.0", "hardhat": "^2.11.1", + "mocha": "^10.0.0", "prettier": "^2.7.1", "prettier-plugin-solidity": "^1.0.0-beta.24", "typescript": "^4.8.2" diff --git a/package.json b/package.json index a6eb09ba..1ed1e2f9 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "eslint": "^8.23.0", "eslint-config-prettier": "^8.5.0", "hardhat": "^2.11.1", + "mocha": "^10.0.0", "prettier": "^2.7.1", "prettier-plugin-solidity": "^1.0.0-beta.24", "typescript": "^4.8.2"