Describe the bug
Set up a test for a call to a function which needs IJSRuntime, omit a call to JSRuntimeInvocationHandler. Normally one would add SetVoidResult(), SetCanceled() or SetException(ex). Then, the test does not halt with no indication of what is misconfigured.
Example:
Testing this component:
private async Task SomeFunction(IJSRuntime runTime)
{
await runTime.InvokeVoidAsync("someFunction");
}
With this test:
[Fact]
public async Task ThisTestDoesNotHalt()
{
// Arrange
var ctx = new TestContext();
ctx.JSInterop.SetupVoid("someFunction");
// Act
await SomeFunction(ctx.JSInterop.JSRuntime);
// Assert
_testOutputHelper.WriteLine("Halting test has succeeded");
}
Results in no output since this test does not halt.
Expected behavior:
I would expect the test to throw some exception or indicate in some other way that the framework is not able to handle such a set up.
Version info:
- bUnit version: 1.40
- .NET Runtime and Blazor version: .NET 9.0.7
- OS type and version: Windows 11 23H2
Describe the bug
Set up a test for a call to a function which needs
IJSRuntime, omit a call toJSRuntimeInvocationHandler. Normally one would addSetVoidResult(),SetCanceled()orSetException(ex). Then, the test does not halt with no indication of what is misconfigured.Example:
Testing this component:
With this test:
Results in no output since this test does not halt.
Expected behavior:
I would expect the test to throw some exception or indicate in some other way that the framework is not able to handle such a set up.
Version info: