env0 Extension for Visual Studio CodeUnleash the power of env0 directly from your Visual Studio Code workspace! The env0 extension allows seamless interaction with your env0 environments, making your development process smoother and more efficient. 🌟 FeaturesView Environments
Execute Actions
Real-time Logs
Notifications
📋 RequirementsBefore using this extension, make sure you meet the following prerequisites:
🔗 Learn how to generate API keys. 🔑 Login and LogoutTo login or logout, simply use the 🌳 Environments ViewFocused Environments View: The environments view is designed to show you only the environments that are specifically associated with the current branch you're working on, keeping your workflow clean and focused. 🚧 LimitationsUnassociated Environments: Although env0 allows environments to be created without specifying a branch (automatically associating them with the default branch), such environments are not displayed in the environments view even if you switch to the default branch. API Key & Organizations: If you're using a personal API key and your account is associated with multiple organizations, the extension will default to a single organization and won't provide an option to select others. 🛠 Setting Up Your Local Development for Contributing
A new VS Code window will now launch, serving as your testing ground for the extension. Quick Tips for DevelopmentTo refresh your debug window without closing it:
⚠️ Note: Some modifications may necessitate the complete closure of the Debugging IDE. 🧪 TestingIntegration TestingRunning the TestsExecute the following command in your terminal to run the integration tests:
DebuggingFor debugging, go to the "Run and Debug" panel in VS Code and select "Extension Test." Libraries Used
Testing AdaptationsThe VS Code API presents some unique challenges, such as not being able to read the content of notification messages or the VS Code output channel. To navigate these challenges, we use jest-mock to stub these functions, allowing us to verify that our code is behaving correctly during tests. Moreover, we import the compiled dist extension file into our test setup. This enables us to run specific functions that are part of the extension, such as resetting its state after each test or ensuring that the Tree View displays the appropriate messages. Unit TestingRunning the TestsTo run the integration tests, execute the following command in your terminal:
Libraries Used
Testing ObjectivesOur unit tests are designed to verify the following functionalities:
Important Note on ImportsWhen working with the tests, it is imperative to import the Test FilesThe unit tests are executed on the source TypeScript files, not on the compiled files. We have integrated 🚀 How to Perform a Release
The workflow automatically bumps the current version specified in your 📚 Recommended ReadingWe recommend familiarizing yourself with the following resources:
Happy Developing! |