Edit: This problem seems to have been fixed with version 7.5.2 of Ionide.
I have a simple unit test project – using Unquote on xUnit – which works fine in VS but I can’t get the unit tests to complete in VS Code.
When I tell VS Code to run the tests via the Run Tests button in the Testing panel the tests run and run but they never complete – I have to cancel the run after about five minutes of watching the little circles spinning.
I don’t get any error messages, the tests just keep ‘running’.
The only VS Code extensions I have installed are:
- C# (I think that was a default extension)
- Ionide for F#
Do I need more? If so, which specific ones?
I’ve read quite a few articles relating to running tests in VS Code but they either don’t mention F#, or Unquote, or both, and they are all quite complicated to read – I just want to run some simple tests, like I did in VS.
The tests look like this:
namespace LuminosityTests
open System
open Xunit
open Swensen.Unquote
open MyStuff.Vector // Contains Luminosity type which is very simple.
module ``fromInt`` =
module ``with minimum luminosity`` =
let luminosity = Luminosity.fromInt 0
[<Fact>]
let ``Value should be same as input value`` () = test <@ luminosity.Value = 0 @>
[<Fact>]
let ``Zero Padded Decimal should be as expected`` () = test <@ luminosity.ZeroPaddedDecimal = "000" @>
[<Fact>]
let ``Decimal should be as expected`` () = test <@ luminosity.Decimal = "0" @>
[<Fact>]
let ``Hex should be as expected`` () = test <@ luminosity.Hex = "00" @>
[<Fact>]
let ``Percentage should be as expected`` () = test <@ luminosity.Percentage = "0%" @>
I’ve attached a screen-grab showing the package references of the UnitTests project (all packages were added via NuGet in VS, not VS Code, as I don’t know how to add stuff via NuGet in VS Code yet because there are too many options and I’m totally confused).
Note: I’d also like to run FsCheck tests too if the ‘fix’ will let me do both.
Note: I’m using VS Code 1.76.0 on Windows 10.