Skip to content

Commit

Permalink
feat: use expecto printer compat layer (#210)
Browse files Browse the repository at this point in the history
Uses TestPrinters builder to insulate YoloDev from printer signature changes

This should reduce the need to coordinated updates, allowing YoloDev to remain unchanged even if the underlying TestPrinters signature changes

Specifically, we plan to add an `isSkipped` parameter to the beforeEach printer.
As-is, that change breaks YoloDev.
This change should fix that
  • Loading branch information
farlee2121 authored Mar 3, 2025
1 parent 1f7f842 commit e90d19a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<ItemGroup>
<PackageVersion Include="Expecto" Version="[10.2.1, 11.0)" />
<PackageVersion Include="Expecto" Version="[10.2.2, 11.0)" />
<PackageVersion Include="FSharp.Core" Version="[7.0.200,)" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageVersion Include="Microsoft.Testing.Extensions.VSTestBridge" Version="1.6.2" />
Expand Down
13 changes: 7 additions & 6 deletions src/YoloDev.Expecto.TestSdk/execution.fs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ module private LogAdapter =

module private PrinterAdapter =
open System
type private TestPrinters = Expecto.Impl.TestPrinters

let create (cases: Map<string, TestCase>) (frameworkHandle: IFrameworkHandle) =
let results = Map.map (fun _ -> TestResult) cases
Expand Down Expand Up @@ -101,12 +102,12 @@ module private PrinterAdapter =
result.Duration <- duration
recordEnd result

{ Expecto.Impl.TestPrinters.silent with
beforeEach = beforeEach
passed = passed
ignored = ignored
failed = failed
exn = exn }
TestPrinters.silent
|> TestPrinters.withBeforeEach beforeEach
|> TestPrinters.withPassed passed
|> TestPrinters.withIgnored ignored
|> TestPrinters.withFailed failed
|> TestPrinters.withExn exn

[<RequireQualifiedAccess>]
module internal Execution =
Expand Down

0 comments on commit e90d19a

Please sign in to comment.