Unverified Commit 31655bc4 authored by yann300's avatar yann300 Committed by GitHub

Merge pull request #2782 from ethereum/unitTesting-docs

unit testing docs updated
parents 8824078b c2788172
docs/images/a-unit-testing-feature.png

52.3 KB | W: | H:

docs/images/a-unit-testing-feature.png

51.5 KB | W: | H:

docs/images/a-unit-testing-feature.png
docs/images/a-unit-testing-feature.png
docs/images/a-unit-testing-feature.png
docs/images/a-unit-testing-feature.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -3,7 +3,7 @@ Unit Testing Plugin ...@@ -3,7 +3,7 @@ Unit Testing Plugin
Click the Click the
![double check](images/a-user-testing-icon.png) ![double check](images/a-user-testing-icon.png)
icon to get to the "Solidity Unit Testing" plugin. icon to get to the `Solidity Unit Testing` plugin.
If you haven't used this plugin before and are not seeing `double check` icon, you have to activate it from Remix plugin manager. If you haven't used this plugin before and are not seeing `double check` icon, you have to activate it from Remix plugin manager.
...@@ -13,11 +13,13 @@ Go to the plugin manager (by click the ![plug](images/a-plug.png) icon) and load ...@@ -13,11 +13,13 @@ Go to the plugin manager (by click the ![plug](images/a-plug.png) icon) and load
Now `double check` icon will appear on the left side icon bar. Clicking on icon will load the unit testing module in the side panel. Now `double check` icon will appear on the left side icon bar. Clicking on icon will load the unit testing module in the side panel.
Alternatively, just select `Solidity` environment from remix IDE home page. This will activate `Solidity Unit Testing` plugin along with `Solidity Compiler`, `Deploy & Run Transactions` & `Solidity Static Analysis` plugins.
![](images/a-unit-testing-feature.png) ![](images/a-unit-testing-feature.png)
Generate Test File Generate
------------------ ----------
Click the button `Generate test file` to create a new solidity file in the current folder suffixed with `_test`. This file contains the minimum you need for running unit testing. Select a solidity file which you want to test and click on the button `Generate`. It will generate a new sample solidity test file **in the current folder** suffixed with `_test`. This file contains the minimum you need for running unit testing.
Write Tests Write Tests
----------- -----------
...@@ -32,13 +34,16 @@ Apart from this, Remix allows usage of some special functions to make testing mo ...@@ -32,13 +34,16 @@ Apart from this, Remix allows usage of some special functions to make testing mo
To get started, see [this simple example](./unittesting_examples.html#simple-example). To get started, see [this simple example](./unittesting_examples.html#simple-example).
Run Tests Run
------------------ -----
Once you are done with writing tests, select the _test.sol files in the list and click on the button `Run` to execute the tests in the selected files. The execution will run in a separate environment and the result will be displayed below.
Click the button "Run tests" to executes all tests whose box has been checked below (by default all). The execution is run in a separate environment and the result is displayed below.
![](images/a-unit-testing-run-result.png) ![](images/a-unit-testing-run-result.png)
Stop
-----
If you have selected multiple files to run the tests and want to stop the execution, click on `Stop` button. It will stop execution after running the tests for current file.
Customization Customization
------------------ ------------------
Remix facilitates users with various types of customizations to test a contract properly. Remix facilitates users with various types of customizations to test a contract properly.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment