vscode-protostar-test-adapter
v0.1.6
Published
Run your Protostar tests in the Sidebar of Visual Studio Code
Downloads
4
Readme
⚠️ WARNING! ⚠️
This repo contains highly experimental code. Expect rapid iteration.
🎟️ Description
vscode extension to view protostar tests in the Test Explorer.
This extension uses vscode native Test API
🎗️ Prerequisites
Minimum protostar version required: 0.2.1
Install or upgrade protostar using the command below:
curl -L https://raw.githubusercontent.com/software-mansion/protostar/master/install.sh | bash
For this extension to work properly, you need to create a dedicated profile named ci
.
This profile should be configured to:
- have no color on output
- have a default target to run all tests
Here is an example of the corresponding section in protostar.toml
file:
[profile.ci.protostar.shared_command_configs]
no_color=true
cairo_path = ["./lib/cairo_contracts/src"]
target = "contracts"
you can test your setup by running the following command:
protostar -p ci test
📦 Installation
Launch VS Code Quick Open (Ctrl+P
), paste the following command, and press enter
.
ext install abuisset.vscode-protostar-test-adapter
🔬 Usage
Click on the Test icon , you should see the list of protostar tests.
Then interact with your tests as any other Test extension.
Test results will be displayed in the test output console.
This extension detects Protostar projects using the protostar.toml
file and/or test files like *test*.cairo
.
If the automatic activation does not work, it is possible to manually launch the extension using the
"Launch Protostar Test Explorer" command accessible from the vscode menu (Ctrl-Shift-P
).
🫶 Contributing
Contribution guidelines are specified in CONTRIBUTING.md. For contribution ideas, please refer to the contribution page.
Here are the steps for local deployment:
- install
yarn
package manager. - install the Test Explorer extension
- fork and clone this repository and open it in VS Code
- run
yarn install
- run
yarn watch
or start the watch Task in VS Code - start the debugger
You should now see a second VS Code window, the Extension Development Host. Open a folder in this window and click the "Test" icon in the Activity bar. Now you should see your test suite in the side panel:
🌡️ Testing
Unit tests are using jest
framework.
To run the tests, simply run the following command:
yarn test
To check code coverage, run:
yarn coverage
To check code formatting, run:
yarn lint
You can also format your code by using the following command:
yarn lint:fix
📄 License
Protostar Test Explorer is released under MIT.