Skip to content

🚀 Feature: API surface for developing an up-to-date VS Code Extension #5039

@Danielku15

Description

@Danielku15

Is your feature request related to a problem or a nice-to-have?? Please describe.
As of today there is no up-to-date integration of Mocha into Visual Studio Code. There is the outdated and not maintained Mocha Test Explorer using an own test explorer instead of the VSCode Integrated one.

I was thinking of making a new extension utilizing the VS Code Testing API based on the examples the provide.

Unfortuantely integrating with Mocha in the right way for scraping the tests and executing them is not easy.

Describe the solution you'd like

It would be great if Mocha would expose additional APIs to fill the missing gap between Mocha and VS Code. For this I would need:

  1. Provide a programmatic way of initializing a Mocha instance from a workspace directory (loading any available configs).
  2. Provide a programmatic way of accessing the test hierarchy including the related file location.
  3. Provide a programmatic way of executing test given any "test hierarchy" objects (as exposed by 2.).
  4. Provide a programmatic way of watching the workspace and listening for any modificiations in the tests to refresh the test hierarchy.

Describe alternatives you've considered

  1. Adopting the code from vscode-mocha-test-adapter which does a lot of stuff manually.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions