Skip to content

Commit e90d19a

Browse files
authored
feat: use expecto printer compat layer (#210)
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
1 parent 1f7f842 commit e90d19a

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<ItemGroup>
3-
<PackageVersion Include="Expecto" Version="[10.2.1, 11.0)" />
3+
<PackageVersion Include="Expecto" Version="[10.2.2, 11.0)" />
44
<PackageVersion Include="FSharp.Core" Version="[7.0.200,)" />
55
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
66
<PackageVersion Include="Microsoft.Testing.Extensions.VSTestBridge" Version="1.6.2" />

src/YoloDev.Expecto.TestSdk/execution.fs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ module private LogAdapter =
4848

4949
module private PrinterAdapter =
5050
open System
51+
type private TestPrinters = Expecto.Impl.TestPrinters
5152

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

104-
{ Expecto.Impl.TestPrinters.silent with
105-
beforeEach = beforeEach
106-
passed = passed
107-
ignored = ignored
108-
failed = failed
109-
exn = exn }
105+
TestPrinters.silent
106+
|> TestPrinters.withBeforeEach beforeEach
107+
|> TestPrinters.withPassed passed
108+
|> TestPrinters.withIgnored ignored
109+
|> TestPrinters.withFailed failed
110+
|> TestPrinters.withExn exn
110111

111112
[<RequireQualifiedAccess>]
112113
module internal Execution =

0 commit comments

Comments
 (0)