-
Notifications
You must be signed in to change notification settings - Fork 677
Writing tests
Tests in the omnisharp vscode use the Mocha framework and the Chai assertion library frameworks. To run all the tests for the repo use : npm run test
.
The repo mainly has the following three categories of tests:
These are the tests that run in isolation and do not need a vscode environment to run within. These tests are the fastest and usually use fake/mocks to test the components completely in isolation. These tests can be run in several ways:
- npm run test:unit
- npm run test:tdd - Run tests in watch mode, so as you make the changes to your files, you can continuously see the tests failing/passing
- Using Wallaby.js
These tests need to be run inside a vscode instance as they rely on the vscode API's. However, they do not test for the language services or the debugger services so they don't rely on external processes like OmniSharp or Debugger.
To run these tests use npm run test:feature
These tests are close to end-to-end tests and require to start the OmniSharp or the debugger process and are hence the slowest.
Currently, there are two sample folders in the assets for the integration tests. These represent two sample workspace types:
To write these tests for the language services features like "Signature Help" of "Completion", we need to wait for the "OmniSharp" server to start in the setup of the tests, so that the server is running and requests can be sent to it for the appropriate language service. To understand these tests better please refer to the vscode complex API commands.
To run these tests use npm run test:integration
When the folder is opened in VSCode, the tests can also be run selecting the appropriate option from the "Debug" menu. The advantage of using this approach is that we can set breakpoints to debug the tests when using this approach.
Configuration
- Configuring Snap installs of dotnet-sdk
- Configuring Arch Linux for Unity development
- Configuring Arch Linux for Razor development
- Installing the .NET Core Debugger on Arch Linux
Debugger
- Overview
- launch.json Help
- Feature List
- Enable Logging
- Portable PDBs
- Troubleshoot Breakpoints
- Attaching to remote processes
- Remote Debugging On Linux-Arm
- Windows Subsystem for Linux
- Diagnosting 'Debug adapter process has terminated unexpectedly'
- Testing libicu compatibility on Linux
- Debugging into the .NET Runtime itself
- Debugging x64 processes on an arm64 computer
Documentation
- Change Log
- Branches and Releases
- Installing Beta Releases
- Installing without internet connectivity
- Linux Support
- Run/Debug Unit Tests
- Troubleshooting: 'The .NET Core SDK cannot be located.' errors
Developer Guide