Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic coverage code lens support [issue-136] #275

Closed
wants to merge 6 commits into from

Conversation

uioporqwerty
Copy link

@uioporqwerty uioporqwerty commented Mar 2, 2024

image

Adds a code lens similar to jest as documented here: #136 (comment)

Current assumptions:

  • User has json as their reporter.
  • Customer coverage reporters unsupported for now.

Improvements and gutter support to follow, but this is a good first step I think. Feedback welcome :)

@@ -76,6 +76,8 @@ export async function runHandler(

run.end()
log.info('Tests run end')

await vscode.commands.executeCommand('editor.action.refreshCodeLens');
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will refresh all the code lens here after the test so ensure they have up to date coverage information

@@ -0,0 +1,92 @@
import * as vscode from 'vscode';
import * as fs from 'fs'
import { describe, expect, it, vi, beforeEach, afterEach } from 'vitest'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are now executed by https://github.com/microsoft/vscode-test-cli with mocha, so I didn't think this would work. Did you run pnpm test?

@sheremet-va
Copy link
Member

The extension was rewritten from the ground up in #253.

Feel free to reimplement this feature in a separate PR. It should be a bit easier because we have direct access to the coverage, and we don't need to read it from the reporter file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants