Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 18, 2025

Upgrades the bunit testing framework from v1.40.0 to v2.3.4 to leverage latest features and fixes.

Changes

  • Package: Updated bunit from 1.40.0 to 2.3.4
  • Base class: TestContextBunitContext in JaTestContext.cs
  • Rendering API: RenderComponent<T>()Render<T>() across all component tests
  • Disposal:
    • Removed DisposeComponents() (no longer available in v2)
    • Added async disposal chain in JaTestContext.DisposeAsync() via await base.DisposeAsync()
    • Fixed SafetyPlanTests.PlanPersists to explicitly save component state before disposal

Example

// Before (bunit v1)
public abstract class JaTestContext : TestContext, IAsyncLifetime
{
    var cut = RenderComponent<SafetyPlanPage>();
    DisposeComponents();
}

// After (bunit v2)
public abstract class JaTestContext : BunitContext, IAsyncLifetime
{
    var cut = Render<SafetyPlanPage>();
    cut.Dispose();
    await base.DisposeAsync();
}

All 171 tests pass.

Original prompt

Upgrade to bunit v2


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI self-assigned this Dec 18, 2025
Co-authored-by: danielchalmers <7112040+danielchalmers@users.noreply.github.com>
Copilot AI changed the title [WIP] Upgrade to bunit v2 Upgrade to bunit v2.3.4 Dec 18, 2025
Copilot AI requested a review from danielchalmers December 18, 2025 23:54
@danielchalmers danielchalmers marked this pull request as ready for review December 18, 2025 23:55
@danielchalmers danielchalmers changed the title Upgrade to bunit v2.3.4 Upgrade to bunit v2.3.4 from 1.40.0 Dec 18, 2025
@danielchalmers
Copy link
Owner

I don't like parts of the implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants