Issafalcon / neotest-dotnet

Neotest adapter for dotnet
MIT License
71 stars 27 forks source link

Test cases with custom attributes are not discovered #78

Closed cizra closed 10 months ago

cizra commented 10 months ago

If a test case is labeled with attributes other than standard xUnit/whatever [Fact], they're not discovered.

using Xunit;
using Exercism.Tests;

public class LuciansLusciousLasagnaTests
{
    [Fact]
    [Task(1)] // remove this line to make neotest-dotnet work
    public void Expected_minutes_in_oven() => Assert.Equal(40, new Lasagna().ExpectedMinutesInOven());
}

Repro:

Issafalcon commented 10 months ago

Hi @cizra - please see the README

I have reproduced the issue you mention before adding in my custom attributes to the config, and then after adding in the following, the test is discoverable and passes:

        require("neotest-dotnet")({
          discovery_root = "solution",
          custom_attributes = {
            xunit = { "Task" },
          },
        }),

I'll close this issue as there is already a fix for custom attributes.

cizra commented 10 months ago

Thanks!