I have the following XUnit test in a project created with dotnet new xunit
:
type Scenarios(output : ITestOutputHelper) =
[<Fact>]
member __.``Output shows up`` () =
output.WriteLine("I'm here")
This approach seems to have worked before, but running the tests doesn't show any output, regardless of whether I use dotnet test
or dotnet xunit
:
> dotnet test
Build started, please wait...
Build completed.
Test run for C:\Work\OSS\Streamstone.fs\tests\StreamstoneFs.Tests\bin\Debug\netcoreapp2.0\StreamstoneFs.Tests.dll(.NETCoreApp,Version=v2.0)
Microsoft (R) Test Execution Command Line Tool Version 15.6.0-preview-20180109-01
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
[xUnit.net 00:00:00.4295013] Discovering: StreamstoneFs.Tests
[xUnit.net 00:00:00.4750480] Discovered: StreamstoneFs.Tests
[xUnit.net 00:00:00.4792986] Starting: StreamstoneFs.Tests
[xUnit.net 00:00:00.5964013] Finished: StreamstoneFs.Tests
Total tests: 1. Passed: 1. Failed: 0. Skipped: 0.
Test Run Successful.
Test execution time: 1.1835 Seconds
> dotnet xunit
Detecting target frameworks in StreamstoneFs.Tests.fsproj...
Building for framework netcoreapp2.0...
StreamstoneFs -> C:\Work\OSS\Streamstone.fs\src\StreamstoneFs\bin\Debug\netstandard2.0\StreamstoneFs.dll
StreamstoneFs.Tests -> C:\Work\OSS\Streamstone.fs\tests\StreamstoneFs.Tests\bin\Debug\netcoreapp2.0\StreamstoneFs.Tests.dll
Running .NET Core 2.0.0 tests for framework netcoreapp2.0...
xUnit.net Console Runner (64-bit .NET Core 4.6.00001.0)
Discovering: StreamstoneFs.Tests
Discovered: StreamstoneFs.Tests
Starting: StreamstoneFs.Tests
Finished: StreamstoneFs.Tests
=== TEST EXECUTION SUMMARY ===
StreamstoneFs.Tests Total: 1, Errors: 0, Failed: 0, Skipped: 0, Time: 0.109s
What am I doing wrong here?
This works in VS Code with a .NET Core project, though it's a bit noisy:
dotnet test --logger:"console;verbosity=detailed"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With