microsoft / microsoft/vscode-extension-test-runner

Issues with Test Discovery

Open
#64 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
17
Forks
15
Avg merge
2d 5h
Merged PRs (30d)
2

Description

I am trying to understand how to perform extension testing using the steps here

I've created an extension example using: "yo code"
I chose esbuild as the bundler and npm as the package manager when prompted.
This results in an extension that includes a test file called extension.test.ts

I've noticed the following:

  1. After opening the workspace, I can execute: "npm run test" from the terminal pane to run the tests
    The test runs, but after it completes the Test Pane is empty and there are no gutter decorations in the extension.test.ts file. If I restart VS Code, the Test Pane shows the tests. Also if I execute "npm run test" from the terminal before starting VS Code the first time, the Test Pane is populated. is this expected?

  2. As I edit the test file, the Test Pane does not update to reflect new tests, or name changes of existing tests. I've found that if I execute: "tsc -p . -w --outDir out" in the terminal, the Test Pane updates for the rest of that session. Is there a way to start the "watch-tests" script each time the workspace is opened?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the generated extension.test.ts and the npm scripts used by the example, then run npm run test and observe the Test Pane before and after restarting VS Code. Compare this with running tsc -p . -w --outDir out and inspect the watch-tests script. Done should clarify and, if appropriate, support initial discovery and updates after test edits without manual watch setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
developer-experience, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.