![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
hardhat-jest
Advanced tools
Warning: If you're using < v1.0.6, Please update the package to the latest version ASAP! It may cause errors.
Have you always wanted to use Jest instead of Mocha + Chai in your Hardhat Projects? 😉 Good News!
hardhat-jest
allows you to use Jest easily 😃✌️
First of all, Make sure that you have jest
already installed!
Step 1: Install the package
npm i hardhat-jest
Step 2: Add to your hardhat.config.js
file
require("hardhat-jest");
If you're using Typescript, to your hardhat.config.ts
file
import "hardhat-jest"; // Typescript
It's so easy, You can run your Jest tests by
npx hardhat jest
You've been using npx hardhat test
to run your Mocha tests so far, but NOW you only need to use jest
instead of test
and Done!
If you're looking to see all the options, you can do it by running npx hardhat help jest
:
Usage: hardhat [GLOBAL OPTIONS] jest [--bail] [--no-compile] [--show-config] [--use-verbose <BOOLEAN>] [--watch] [--watch-all]
OPTIONS:
--bail Stop running tests after the first test failure.
--no-compile Do NOT compile before running this task.
--show-config Print your jest config and then exits.
--watch Watch files for changes and rerun tests related to changed files.
--watch-all Watch files for changes and rerun all tests.
--use-verbose Display individual test results with the test suite hierarchy. | Enable / Disable [boolean] (default: false)
jest: Runs Jest tests
For global options help run: hardhat help
to use options, you can easily run
npx hardhat jest <option-name>
// for example
npx hardhat jest --no-compile --watch
If you want Jest to display individual test results with the test suite hierarchy, you can use --use-verbose
this way:
npx hardhat jest --use-verbose true // enables verbose mode only for this project
npx hardhat jest --use-verbose false // disables verbose mode for the project
Remember: the default value is false
and disabled, so you must enable it if you want.
If you want Jest to run only specific files instead of all test files, you can do that by:
npx hardhat jest test/Test3.test.js test/Test4.test.js
NOTE: You must specify files with their full path (from the project root directory)
You can see all the available Hardhat tasks by running npx hardhat
AVAILABLE TASKS:
check Check whatever you need
clean Clears the cache and deletes all artifacts
compile Compiles the entire project, building all artifacts
console Opens a hardhat console
coverage Generates a code coverage report for tests
flatten Flattens and prints contracts and their dependencies
gas-reporter:merge
help Prints this message
> jest Runs Jest tests
node Starts a JSON-RPC server on top of Hardhat Network
run Runs a user-defined script after compiling the project
test Runs mocha tests
typechain Generate Typechain typings for compiled contracts
verify Verifies contract on Etherscan
and There it is, jest
task is added successfully! it means that you can run npx hardhat jest
and your tests will be run!
Finally, show us some love by starring the repository on GitHub!️ 😊
Happy hacking!
FAQs
A Hardhat plugin that allows you to use Jest easily!
The npm package hardhat-jest receives a total of 0 weekly downloads. As such, hardhat-jest popularity was classified as not popular.
We found that hardhat-jest demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.