• Stars
    star
    203
  • Rank 192,890 (Top 4 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

.NET Core Test Explorer for Visual Studio Code

Gitter chat

.NET Core Test Explorer

Features

  • Test Explorer for .NET Core

Prerequisites

  • .NET Core is installed
  • NUnit and MSTest requires a dotnet sdk version of >= 2.2.104.

New in 0.7.8

  • Bug fix for tree view rendering

Usage

Open a .NET Core test project, or set dotnet-test-explorer.testProjectPath to the folder path of .NET Core test project. Then, you will see all the tests in Test Explorer. More information on how to set the testProjectPath can be found below under Settings.

Settings

The settings are available via File / Preferences / Settings. Navigate to extensions and .NET Core test explorer.

image

Settings examples

dotnet-test-explorer.testProjectPath

Glob pattern that points to path of .NET Core test project(s). A common pattern is "**/*Tests.csproj".

Given the folder structure

  • root
    • testProjectOne
      • testproject1.Tests.csproj
    • testProjectTwo
      • testproject2.Tests.csproj

the glob pattern "+(testProjectOne|testProjectTwo)" or "**/*Tests.csproj" should add both of the test projects.

dotnet-test-explorer.autoWatch

If true, starts dotnet watch test after test discovery is completed

dotnet-test-explorer.testArguments

Additional arguments that are added to the dotnet test command. These can for instance be used to collect code coverage data ("/p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=../../lcov.info") or pass test settings ("--settings:./myfilename.runSettings")

Stopping the current test runner(s)

Press the stop button in the top menu. This also works as a reset of sorts so if the extension has managed to end up in a weird state where it thinks a test is running even though it is not or that the debugger is running even though it is not the stop button can solve these types of issues as well.

test-explorer

Logging

Text from the dotnet test output as well as debug info is written to the Output/Test explorer terminal window. To view the log you can access it simply by clicking the view log icon.

showlog

Debugging (alpha)

To debug a test, right click the test and choose to Debug test. The option to run and debug test that appear in the code lens are provided by the omnisharp plugin and has nothing to do with this extension.

The debugger might get stuck before loading your test assembly code. If this happens you can continue the debug process (F5) and it should load the rest of the assemblies and stop and the desired breakpoint.

Keyboard shortcuts

  • Run all tests, default Alt+R Alt+A

  • Rerun last command, default Alt+R Alt+R

  • Run test(s) in context, default Alt+R Alt+C

Known issues

Go to test does not work with multiple workspaces

This is because of limitations in the omnisharp extensions. We can only navigate to symbols which are in the currently selected workspace.

Test result is not shown in CodeLens / tree

Try and change the setting dotnet-test-explorer.pathForResultFile to point to a folder you have access right too. CodeLens functionality also requires the C# extension)

No tree view or color-coded explorer for NUnit / MSTest

This requires you to run dotnet SDK version 2.2.104 or higher.

xUnit projects assembly name needs to match the test class namespace

See #201

DisplayName attribute not working for xUnit

See #56

Project discovery with UNC Paths doesn't work

See #179

Telemetry data

By default, anonymous telemetry data collection is turned on to understand user behavior to improve this extension. To disable it, update the settings.json as below:

{
    "dotnet-test-explorer.enableTelemetry": false
}

Change Log

See Change Log here

Issues

If you find any bug or have any suggestion/feature request, please submit the issues to the GitHub Repo.

❤️ Contributors

Thanks to all the contributors!

Special thanks to Stefan Forsberg (@stefanforsberg) for maintaining the project and implementing so many cool features! Also thanks to Janaka Abeywardhana (@janaka) for maintaining the project!

More Repositories

1

955.WLB

955 不加班的公司名单 - 工作 955,work–life balance (工作与生活的平衡)
33,386
star
2

vscode-code-runner

Code Runner for Visual Studio Code
TypeScript
2,016
star
3

944.Life

996.ICU 的反向 repo: 944 工作制 - 工作 944,生活为先
976
star
4

awesome-gpt

A curated list of awesome projects and resources related to GPT, ChatGPT, OpenAI, LLM, and more.
873
star
5

awesome-vscode-cn

中文版 Awesome VS Code
778
star
6

vscode-ycy

超越鼓励师 for VS Code
TypeScript
289
star
7

vscode-auto-rename-tag

Automatically rename paired HTML/XML tag
TypeScript
243
star
8

vscode-mysql

MySQL management tool for Visual Studio Code
TypeScript
212
star
9

chatgpt-teams-bot

A ChatGPT Teams Bot app to let you chat with ChatGPT in Microsoft Teams
TypeScript
200
star
10

vscode-auto-close-tag

Auto Close Tag for Visual Studio Code
TypeScript
169
star
11

awesome-azure-iot

A curated list of awesome Azure Internet of Things projects and resources.
127
star
12

openai-teams-bot

An OpenAI Teams Bot app to let you chat with OpenAI API in Microsoft Teams, similar to ChatGPT Teams Bot app
TypeScript
116
star
13

weapp-955-wlb

955WLB 微信小程序
JavaScript
102
star
14

semantic-kernel-vs-langchain

Compare Semantic Kernel and LangChain
64
star
15

vscode-iot-utility

IoT Utility for Visual Studio Code: Arduino, Espressif, Raspberry Pi, mbed and more
TypeScript
64
star
16

vscode-code-runner-for-web

Run code in browser version of VS Code
TypeScript
49
star
17

vscode-terminal

Terminal for Visual Studio Code
TypeScript
43
star
18

vscode-docker-explorer

Docker Explorer for Visual Studio Code
TypeScript
42
star
19

chatgpt-wechat-bot

ChatGPT 微信机器人,基于 ChatGPT API 和 Wechaty
JavaScript
29
star
20

vscode-translator

VS Code extension to translate between English and Chinese.
TypeScript
25
star
21

vscode-node-red

Node-RED for Visual Studio Code
TypeScript
19
star
22

openai-examples

Code Samples for OpenAI & ChatGPT API
JavaScript
16
star
23

vscode-github-actions

GitHub Actions for VS Code
TypeScript
14
star
24

CodeRunnerVS

Code Runner for Visual Studio
C#
10
star
25

vscode-955-wlb

955.WLB extension for Visual Studio Code
TypeScript
10
star
26

vscode-dotnet

.NET Core Tools for Visual Studio Code
TypeScript
10
star
27

chatgpt-wechat-public-account

把 ChatGPT 接入微信公众号
Python
9
star
28

vscode-azure-storage-explorer

Manage Azure Storage in Visual Studio Code
TypeScript
7
star
29

vscode-azure-iot-toolkit

This extension is now maintained in the Microsoft repo
TypeScript
6
star
30

vscode-extension-leaderboard

Data insight for popular extensions, history of download count and extension leaderboard
TypeScript
6
star
31

vsce-website

Source Code for Visual Studio Code Extension Download Count
JavaScript
6
star
32

vscode-auto-complete-tag

Extension Pack to add close tag and rename paired tag automatically for HTML/XML
6
star
33

formulahendry.github.io.source

Source repo for personal blog
JavaScript
5
star
34

azure-iot-toolkit-for-mobile

Azure IoT Toolkit for Android, iOS and Windows Phone
JavaScript
4
star
35

vscode-iot-extension-pack

Build IoT Solutions on top of awesome technology stacks
4
star
36

weapp-garbage-classification

JavaScript
3
star
37

vscode-chat-room

Chat Room & Chat Bot for VS Code
TypeScript
3
star
38

azure-iot-webclient

Azure IoT Web Client
JavaScript
3
star
39

teams-bot-semantic-kernel

A Teams Bot app integrated with Semantic Kernel and its Microsoft Graph Plugin
C#
2
star
40

teams-bot-langchain

A Teams Bot app integrated with LangChain
TypeScript
2
star
41

vscode-azure-virtual-machine-explorer

Manage Azure Virtual Machine in VS Code
TypeScript
2
star
42

my-first-static-web-app

HTML
1
star
43

azure-cli-content-test

1
star
44

vscode-docker-extension-pack

Docker Extension Pack for Visual Studio Code
1
star
45

intro-html

A robot powered training repository 🤖
1
star
46

uwp-vsce

UWP for Visual Studio Code Extension Marketplace
HTML
1
star
47

awesome-azure-for-java

A curated list of awesome Azure projects and resources for Java
1
star
48

vscode-azure-iot-toolkit-1

TypeScript
1
star