I am having an issue getting approval tests to work. To demonstrate, I have created a simple test:
Code:
open VerifyXunit
open Xunit
[<UsesVerify>]
module NcrunchTests =
[<Fact>]
let ``test explorer and NCrunch should both work`` () =
Verifier.Verify("Hello World!").ToTask() |> Async.AwaitTask
In the Test Explorer, the above work, but it fails in NCrunch. I guess it may have something to do with the approval file (and location), but I am at a loss on exactly what and how to fix it. The NCrunch output trace is:
System.AggregateException: One or more errors occurred. (Could not find project directory)
at Xunit.Sdk.TestInvoker`1.<>c__DisplayClass48_0.<<InvokeTestMethodAsync>b__1>d.MoveNext() in /_/src/xunit.execution/Sdk/Frameworks/Runners/TestInvoker.cs:line 264
--- End of stack trace from previous location ---
at Xunit.Sdk.ExecutionTimer.AggregateAsync(Func`1 asyncAction) in /_/src/xunit.execution/Sdk/Frameworks/ExecutionTimer.cs:line 48
at Xunit.Sdk.ExceptionAggregator.RunAsync(Func`1 code) in /_/src/xunit.core/Sdk/ExceptionAggregator.cs:line 90
System.Exception: Could not find project directory
at ProjectDirectoryFinder.Find(String testDirectory) in /_/src/Verify/Verifier/ProjectDirectoryFinder.cs:line 7
at InnerVerifier.ResolveDirectory(String sourceFile, VerifySettings settings, PathInfo pathInfo) in /_/src/Verify/Verifier/InnerVerifier.cs:line 189
at InnerVerifier..ctor(String sourceFile, VerifySettings settings, String typeName, String methodName, List`1 methodParameters, PathInfo pathInfo) in /_/src/Verify/Verifier/InnerVerifier.cs:line 29
at VerifyXunit.Verifier.GetVerifier(VerifySettings settings, String sourceFile, Boolean useUniqueDirectory) in /_/src/Verify.Xunit/Verifier.cs:line 24
at VerifyXunit.Verifier.<>c__DisplayClass6_0.<<Verify>b__0>d.MoveNext() in /_/src/Verify.Xunit/Verifier.cs:line 63