Awesome
<img align="right" width="150" height="150" top="100" src="./assets/logo.png">VSCode Foundry Test Runner •
An extension for VSCode editor to easily explore and run tests using the foundry framework. This is an adapter that is intended to work with the Test Explorer UI extension.
Note: This adapter is in a very early stage. Beta testers are welcome!
Features at a glance:
- Displays a Test Explorer in the Test view of VS Code's sidebar with all detected tests and suites along with their state.
- Adds CodeLenses to your test files for running specific tests.
- Display test logs in the Output panel.
- Allows for verbosity configuration.
- Exclude test files and test functions.
- More to come....
Requirements
The following will need to be installed in order to use this template. Please follow the links and instructions.
- Foundry / Foundryup
- This will install
forge
,cast
,chisel
andanvil
- You can test you've installed them right by running
forge --version
and get an output like:forge 0.2.0 (f016135 2022-07-04T00:15:02.930499Z)
- To get the latest of each, just run
foundryup
- This will install
Usage
The usage of this extension is straightforward.
- Install this adapter extension.
- Install the Test Explorer UI extension.
- Click on the Test Icon displayed on the Activity bar.
- Run your tests using the Run icon in the Test Explorer or the CodeLenses in your test file
1.) Run a single test from the explorer
<img src="./assets/single_test.gif" />2.) Run a test suite (all the tests in a contract) from the explorer
<img src="./assets/run_suite.gif" />3.) Run a test using the Codelens (inline option in the editor)
<img src="./assets/codelens.gif" />4.) Configure verbosity, exclude test contracts and functions
<img src="./assets/settings.png" /><!-- CONTRIBUTING -->
Contributing
Contributions are welcomed. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
TODO
- Contract-level codelens to run test suites from the editor
- Flexibility to set the verbosity level
- Add options to exclude tests and test files
- Add option to debug the tests
- Optimize the
runNode()
function - Display coverage?