Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unit testing docs updated #2782

Merged
merged 2 commits into from
Apr 29, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified docs/images/a-unit-testing-feature.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 13 additions & 8 deletions docs/unittesting.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Unit Testing Plugin

Click the
![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.

Expand All @@ -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.

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)

Generate Test File
------------------
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.
Generate
----------
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
-----------
Expand All @@ -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).

Run Tests
------------------

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.
Run
-----
Once you are done with writing tests, select the right file(s) 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "select the right file(s)" is confusing - because right has many meaning here. So here's an edit:

select the _test.sol files in the list and ...


![](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
------------------
Remix facilitates users with various types of customizations to test a contract properly.
Expand Down