keploy / keploy

Unit and Integration Test generation for Developers. Generate tests and stubs for your application that actually work!
https://keploy.io
Apache License 2.0
5.11k stars 497 forks source link

[feature]: Add Tests to the VSCode Extension and CI Pipeline #2257

Open SkySingh04 opened 2 months ago

SkySingh04 commented 2 months ago

👀 Is there an existing feature request for this?

🔖 Enhancement description

We can implement tests for our Vs Code extensions using the VS Code/test-cli and VS Code/test-electron module that enables tests to be run in VS Code Desktop. Inside our extension.test.ts file we can define a test suite for registering a Test-Sidebar with our existing Sidebar Provider.

We can then test the content being rendered in our Test-Sidebar to match the content we expect it to display to test if our sidebar is rendering properly or not. In this example, we test if the rendered Html contains a certain css link tag which asserts if the webview content is being rendered properly or not. This functionality can be expanded to further test if other buttons/webviews are being rendered and are functioning as expected or not.

We can run the tests usingnpm run test which triggers the script to run VS Code-test , which searches for test files as per our defined configuration in the .VS Code-test.mjs file.

Deliverables:

🎤 Why should this be worked on?

Promotes testing standards

💻 Repository

vscode-extension

akshat99812 commented 2 months ago

I would love to work on this can this be assigned to me.

SkySingh04 commented 2 months ago

@akshat99812 Go for it!

akshat99812 commented 2 months ago

I have successfully implemented tests for rendering HTML elements. However, I need some guidance in testing button clicks within the Svelte files. Could you provide assistance in writing and running tests for interactions with Svelte components? @Akash-Singh04