diff --git a/content/tutorials/how-to-test-contracts/10.index.md b/content/tutorials/how-to-test-contracts/10.index.md index 323708d..d948b79 100644 --- a/content/tutorials/how-to-test-contracts/10.index.md +++ b/content/tutorials/how-to-test-contracts/10.index.md @@ -6,7 +6,7 @@ description: Learn how to test your smart contracts locally using era-test-node This tutorial provides a step-by-step guide on testing smart contracts using the `hardhat-chai-matchers` plugin in conjunction with the **ZKsync Era Test Node** on your local machine. -To facilitate this process of running tests on the **ZKsync Era Test Node**, you'll also utilize the `hardhat-zksync-node` plugin. +To facilitate this process of running tests on the **ZKsync Era Test Node**, you'll also utilize the `hardhat-zksync` plugin. ## Prerequisites @@ -16,7 +16,7 @@ To facilitate this process of running tests on the **ZKsync Era Test Node**, you ## Era-test-node plugin In this tutorial, the contract functionality is tested using the [ZKsync Era Test Node](https://docs.zksync.io/build/test-and-debug/in-memory-node). -To start local node we use the `hardhat-zksync-node` plugin to integrate this functionality within the Hardhat project. +To start local node we use the `hardhat-zksync` plugin to integrate this functionality within the Hardhat project. ::callout{icon="i-heroicons-exclamation-triangle"} During the alpha phase, ZKsync Era Test Nodes are currently undergoing development, wherein certain functionalities might not be fully supported or operational. @@ -34,18 +34,18 @@ npx hardhat init Select the `Create a TypeScript project` option and install the sample project's dependencies: `hardhat` and `@nomicfoundation/hardhat-toolbox`. -To install the `hardhat-zksync-node` plugin, execute the following command: +To install the `hardhat-zksync` plugin, execute the following command: ::code-group ```bash [npm] -npm i -D @matterlabs/hardhat-zksync-node +npm i -D @matterlabs/hardhat-zksync ``` ```bash [yarn] -yarn add -D @matterlabs/hardhat-zksync-node +yarn add -D @matterlabs/hardhat-zksync ``` :: @@ -56,7 +56,7 @@ Once installed, add the plugin at the top of your `hardhat.config.ts` file. data-at-line="3"> ```ts [hardhat.config.ts] -import "@matterlabs/hardhat-zksync-node"; +import "@matterlabs/hardhat-zksync"; ``` ### Starting the ZKsync Era Test Node @@ -98,7 +98,7 @@ You should see output similar to this: 09:04:44 INFO ======================================== ``` -Since we've confirmed that the **ZKsync Era Test Node** is functioning properly with the help of the `hardhat-zksync-node` plugin, +Since we've confirmed that the **ZKsync Era Test Node** is functioning properly with the help of the `hardhat-zksync` plugin, we can shut it down and continue with the tutorial. ### Integration with Hardhat @@ -133,22 +133,21 @@ In the root directory of your project, execute this command: ::code-group ```bash [npm] -npm i -D @nomicfoundation/hardhat-chai-matchers chai@4.3.6 @matterlabs/hardhat-zksync +npm i -D @nomicfoundation/hardhat-chai-matchers chai@4.3.6 ``` ```bash [yarn] -yarn add -D @nomicfoundation/hardhat-chai-matchers chai@4.3.6 @matterlabs/hardhat-zksync +yarn add -D @nomicfoundation/hardhat-chai-matchers chai@4.3.6 ``` :: -After installing it, add the plugins at the top of your `hardhat.config.ts` file: +After installing it, add the plugin at the top of your `hardhat.config.ts` file: ```ts [hardhat.config.ts] -import "@matterlabs/hardhat-zksync"; import "@nomicfoundation/hardhat-chai-matchers"; ``` @@ -159,7 +158,6 @@ With the previous steps completed, your `hardhat.config.ts` file should now be p ```ts [hardhat.config.ts] import { HardhatUserConfig } from "hardhat/config"; import "@nomicfoundation/hardhat-toolbox"; -import "@matterlabs/hardhat-zksync-node"; import "@matterlabs/hardhat-zksync"; import "@nomicfoundation/hardhat-chai-matchers"; @@ -306,7 +304,7 @@ However, if you prefer to compile manually, simply run the following command `np :: -The `hardhat-zksync-node` plugin overrides the default behavior of the Hardhat `test` task. +The `hardhat-zksync` plugin overrides the default behavior of the Hardhat `test` task. It starts the **ZKsync Era Test Node** before running tests, executes the tests, and then automatically shuts down the node after the test cases are completed.