Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Protostar Test ExplorerNew to Visual Studio Code? Get it now.

Protostar Test Explorer

Anthony BUISSET

|
31 installs
| (0) | Free
Run your Protostar tests in the Sidebar of Visual Studio Code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Protostar Test Explorer

vscode extension to view protostar tests in the Test Explorer.

⚠️ 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.

test view

Then interact with your tests as any other Test extension.

🫶 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 the your test suite in the side panel:

test view

🌡️ Testing

Unit tests are using jest framework. In order 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 the MIT.

❓ Reference

  • vscode Test API
  • protostar
  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2022 Microsoft