← all modules

Sky.Test

Sky.Test

Types
  type Test = Leaf String (() -> TestResult) | Suite String (List Test)
  type TestResult = Passed | Failed String

Values
  equal : a -> a -> TestResult
  err : Result e a -> TestResult
      Assert a Result is Err.
  expectErrorKind : ErrorKind -> Result Error a -> TestResult
      Assert a Result is Err with a specific ErrorKind. Most commonly
  fail : String -> TestResult
      Fail unconditionally with a message. Use sparingly — prefer a
  isFalse : Bool -> TestResult
  isTrue : Bool -> TestResult
  jsonReport : List ( String, TestResult ) -> String
      Render a completed run as machine-readable JSON.
  notEqual : a -> a -> TestResult
  ok : Result e a -> TestResult
      Assert a Result is Ok. The Ok value is discarded — use `equal`
  pass : TestResult
      Pass unconditionally. Useful when an assertion is conditional and
  run : List Test -> List ( String, TestResult )
      Execute a list of tests and return the flat list of
  suite : String -> List Test -> Test
  summarise : List ( String, TestResult ) -> Bool
      Print a human-readable summary. Returns True iff every test
  test : String -> (() -> TestResult) -> Test
  writeJsonReport : String -> List ( String, TestResult ) -> Task Error ()
      Write `jsonReport` to `path`. An empty path is a no-op, so the
  runMain
      Convenience entry-point. A test module can declare: