A node:test runner
npm install @nomicfoundation/hardhat-node-test-runnerThis plugin integrates the native Node.js Test Runner (or node:test) into Hardhat.
> This plugin is part of the Viem Hardhat Toolbox. If you are using that toolbox, there's nothing else you need to do.
To install this plugin, run the following command:
``bash`
npm install --save-dev @nomicfoundation/hardhat-node-test-runner
In your hardhat.config.ts file, import the plugin and add it to the plugins array:
`ts
import { defineConfig } from "hardhat/config";
import hardhatNodeTestRunner from "@nomicfoundation/hardhat-node-test-runner";
export default defineConfig({
plugins: [hardhatNodeTestRunner],
});
`
This plugin defines a new task called test nodejs that runs your tests using node:test. This task gets executed automatically when running npx hardhat test`.