0

Expecto allows you to set parameters via CLIArguments and also by overriding its defaultConfig. One of the parameters is --summary. Currently I just directly pass "--summary" and merge it with argv but is there a parameter (I assume 'printer') that can be overridden? In that case, how? This is what I do now:

open Expecto
open Expecto.Impl
open Expecto.Logging

[<EntryPoint>]
let main argv =
    let defaultConfig = {
            defaultConfig with
                colour = Logging.Colour256
                verbosity = LogLevel.Info
        }
    let argv = Array.append argv [|"--summary"|]
    Tests.runTestsInAssembly defaultConfig argv
s952163
  • 6,276
  • 4
  • 23
  • 47
  • 2
    I'd change the name of your `defaultConfig` and call it just `config` or `customConfig`. Because it's no longer the default since you're changing some values, so the name `defaultConfig` is no longer really true. – rmunn Aug 30 '19 at 02:22

1 Answers1

1

From source code

| Summary -> fun o -> {o with printer = TestPrinters.summaryPrinter o.printer}
dvitel
  • 563
  • 3
  • 10
  • Ah, I see, thank you. So the defaultConfig should have `printer = TestPrinters.summaryPrinter defaultConfig.printer`. – s952163 Aug 30 '19 at 00:10