Skip to content

Include test name that is causing Bunit.JSRuntimeUnhandledInvocationException #521

@anddrzejb

Description

@anddrzejb

Is the feature request related to a problem? Please elaborate.
I develop in Visual Studio. I often am in a situation that my local tests are passing, but in github actions I get an exception like this:

Bunit.JSRuntimeUnhandledInvocationException: bUnit's JSInterop has not been configured to handle the call:

    InvokeVoidAsync("AntDesign.interop.domManipulationHelper.scrollTo", Microsoft.AspNetCore.Components.ElementReference, Microsoft.AspNetCore.Components.ElementReference)

Configure bUnit's JSInterop to handle the call with following:

    SetupVoid("AntDesign.interop.domManipulationHelper.scrollTo", Microsoft.AspNetCore.Components.ElementReference, Microsoft.AspNetCore.Components.ElementReference)
or the following, to match any arguments:
    SetupVoid("AntDesign.interop.domManipulationHelper.scrollTo", _ => true)

The setup methods are available on an instance of the BunitJSInterop or
BunitJSModuleInterop type. The standard BunitJSInterop is available
through the TestContext.JSInterop property, and a BunitJSModuleInterop
instance is returned from calling SetupModule on a BunitJSInterop instance.

   at Bunit.BunitJSInterop.TryHandlePlannedInvocation[TValue](JSRuntimeInvocation invocation) in /_/src/bunit.web/JSInterop/BunitJSInterop.cs:line 84
   at Bunit.BunitJSInterop.HandleInvocation[TValue](JSRuntimeInvocation invocation) in /_/src/bunit.web/JSInterop/BunitJSInterop.cs:line 69
   at Bunit.JSInterop.Implementation.JSRuntimeExtensions.HandleInvokeAsync[TValue](BunitJSInterop jSInterop, String identifier, Object[] args) in /_/src/bunit.web/JSInterop/Implementation/JSRuntimeExtensions.cs:line 14
   at Bunit.JSInterop.BunitJSRuntime.InvokeAsync[TValue](String identifier, Object[] args) in /_/src/bunit.web/JSInterop/Implementation/BunitJSRuntime.cs:line 23
   at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
   at AntDesign.AntComponentBase.JsInvokeAsync(String code, Object[] args) in /home/runner/work/ant-design-blazor/ant-design-blazor/components/core/Base/AntComponentBase.cs:line 

My problem is that I have no clue which test actually has this issue.

The suggested solution
Is it possible to add to the message the offending test name?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions