Http4sSuite

trait Http4sSuite extends CatsEffectSuite with DisciplineSuite with ScalaCheckEffectSuite with Http4sSuitePlatform

Common stack for http4s' munit based tests

Source:
Http4sSuite.scala
trait DisciplineSuite
trait ScalaCheckSuite
class CatsEffectSuite
trait CatsEffectFunFixtures
trait CatsEffectFixtures
trait CatsEffectFixturesPlatform
trait CatsEffectAssertions
class FunSuite
trait ValueTransforms
trait SuiteTransforms
trait TestTransforms
trait TestOptionsConversions
trait FunFixtures
trait Assertions
trait CompileErrorMacro
class Suite
trait PlatformSuite
class Object
trait Matchable
class Any

Type members

Classlikes

implicit class ParseResultSyntax[A](self: ParseResult[A])

Inherited classlikes

abstract class Fixture[T](val fixtureName: String)
Value parameters:
name

The name of this fixture, used for displaying an error message if beforeAll() or afterAll() fail.

Inherited from:
Suite
Source:
Suite.scala
class FunFixture[T]
Inherited from:
FunFixtures
Source:
FunFixtures.scala
object FunFixture
Inherited from:
FunFixtures
Source:
FunFixtures.scala
final class SuiteTransform(val name: String, fn: List[Test] => List[Test]) extends List[Test] => List[Test]
final class TestTransform(val name: String, fn: Test => Test) extends Test => Test

Similar to ResourceSuiteLocalFixture, but supported on both JVM and JS via several caveats. Instead of directly providing T provides a (memoized) IO[T] that is backed by a Deferred[T]. It is unsafe because on JS the resource is closed concurrently without backpressure, i.e. the suite will complete even while the resource has not closed yet. On JVM it is semantically equivalent to ResourceSuiteLocalFixture. Note also that constructing this fixture is impure because it unsafely allocates a Deferred.

Similar to ResourceSuiteLocalFixture, but supported on both JVM and JS via several caveats. Instead of directly providing T provides a (memoized) IO[T] that is backed by a Deferred[T]. It is unsafe because on JS the resource is closed concurrently without backpressure, i.e. the suite will complete even while the resource has not closed yet. On JVM it is semantically equivalent to ResourceSuiteLocalFixture. Note also that constructing this fixture is impure because it unsafely allocates a Deferred.

Inherited from:
CatsEffectFixtures
Source:
CatsEffectFixtures.scala
final class ValueTransform(val name: String, fn: PartialFunction[Any, Future[Any]]) extends Any => Option[Future[Any]]

Inherited types

final type AfterEach = GenericAfterEach[TestValue]
Inherited from:
Suite
Source:
Suite.scala
final type BeforeEach = GenericBeforeEach[TestValue]
Inherited from:
Suite
Source:
Suite.scala
final type Test = GenericTest[TestValue]
Inherited from:
Suite
Source:
Suite.scala
final type TestValue = Future[Any]
Inherited from:
FunSuite
Source:
FunSuite.scala

Value members

Concrete methods

override def munitFixtures: Seq[Fixture[_]]
Definition Classes
Suite
Source:
Http4sSuite.scala
override def unitToProp: Unit => Prop
Definition Classes
ScalaCheckSuite
Source:
Http4sSuite.scala
def writeToString[A](a: A)(implicit W: EntityEncoder[IO, A]): IO[String]

Inherited methods

def afterAll(): Unit

Runs once after all test cases and after all suite-local fixtures have been tear down.

Runs once after all test cases and after all suite-local fixtures have been tear down.

Inherited from:
Suite
Source:
Suite.scala
def afterEach(context: AfterEach): Unit

Runs after each individual test case.

Runs after each individual test case.

Inherited from:
Suite
Source:
Suite.scala
def assert(cond: => Boolean, clue: => Any)(implicit loc: Location): Unit
Inherited from:
Assertions
Source:
Assertions.scala
def assertEquals[A, B](obtained: A, expected: B, clue: => Any)(implicit loc: Location, ev: B <:< A): Unit

Asserts that two elements are equal using == equality.

Asserts that two elements are equal using == equality.

The "expected" value (second argument) must have the same type or be a subtype of the "obtained" value (first argument). For example:

 assertEquals(Option(1), Some(1)) // OK
 assertEquals(Some(1), Option(1)) // Error: Option[Int] is not a subtype of Some[Int]

Use assertEquals[Any, Any](a, b) as an escape hatch to compare two values of different types. For example:

 val a: Either[List[String], Int] = Right(42)
 val b: Either[String, Int]       = Right(42)
 assertEquals[Any, Any](a, b) // OK
 assertEquals(a, b) // Error: Either[String, Int] is not a subtype of Either[List[String], Int]
Inherited from:
Assertions
Source:
Assertions.scala
def assertEqualsDouble(obtained: Double, expected: Double, delta: Double, clue: => Any)(implicit loc: Location): Unit

Asserts that two doubles are equal to within a positive delta. If the expected value is infinity then the delta value is ignored. NaNs are considered equal: assertEquals(Double.NaN, Double.NaN, *) passes.

Asserts that two doubles are equal to within a positive delta. If the expected value is infinity then the delta value is ignored. NaNs are considered equal: assertEquals(Double.NaN, Double.NaN, *) passes.

Inherited from:
Assertions
Source:
Assertions.scala
def assertEqualsFloat(obtained: Float, expected: Float, delta: Float, clue: => Any)(implicit loc: Location): Unit

Asserts that two floats are equal to within a positive delta. If the expected value is infinity then the delta value is ignored. NaNs are considered equal: assertEquals(Float.NaN, Float.NaN, *) passes.

Asserts that two floats are equal to within a positive delta. If the expected value is infinity then the delta value is ignored. NaNs are considered equal: assertEquals(Float.NaN, Float.NaN, *) passes.

Inherited from:
Assertions
Source:
Assertions.scala
def assertIO[A, B](obtained: IO[A], returns: B, clue: => Any)(implicit loc: Location, ev: B <:< A): IO[Unit]

Asserts that an IO returns an expected value.

Asserts that an IO returns an expected value.

The "returns" value (second argument) must have the same type or be a subtype of the one "contained" inside the IO (first argument). For example:

 assertIO(IO(Option(1)), returns = Some(1)) // OK
 assertIO(IO(Some(1)), returns = Option(1)) // Error: Option[Int] is not a subtype of Some[Int]

The "clue" value can be used to give extra information about the failure in case the assertion fails.

Value parameters:
clue

a value that will be printed in case the assertions fails

obtained

the IO under testing

returns

the expected value

Inherited from:
CatsEffectAssertions
Source:
CatsEffectAssertions.scala
def assertNoDiff(obtained: String, expected: String, clue: => Any)(implicit loc: Location): Unit
Inherited from:
Assertions
Source:
Assertions.scala
def assertNotEquals[A, B](obtained: A, expected: B, clue: => Any)(implicit loc: Location, ev: A =:= B): Unit
Inherited from:
Assertions
Source:
Assertions.scala
def assertSyncIO[A, B](obtained: SyncIO[A], returns: B, clue: => Any)(implicit loc: Location, ev: B <:< A): SyncIO[Unit]

Asserts that a SyncIO returns an expected value.

Asserts that a SyncIO returns an expected value.

The "returns" value (second argument) must have the same type or be a subtype of the one "contained" inside the SyncIO (first argument). For example:

 assertSyncIO(SyncIO(Option(1)), returns = Some(1)) // OK
 assertSyncIO(SyncIO(Some(1)), returns = Option(1)) // Error: Option[Int] is not a subtype of Some[Int]

The "clue" value can be used to give extra information about the failure in case the assertion fails.

Value parameters:
clue

a value that will be printed in case the assertions fails

obtained

the SyncIO under testing

returns

the expected value

Inherited from:
CatsEffectAssertions
Source:
CatsEffectAssertions.scala
def assume(cond: Boolean, clue: => Any)(implicit loc: Location): Unit
Inherited from:
Assertions
Source:
Assertions.scala

Runs once before all test cases and before all suite-local fixtures are setup. An error in this method aborts the test suite.

Runs once before all test cases and before all suite-local fixtures are setup. An error in this method aborts the test suite.

Inherited from:
Suite
Source:
Suite.scala
def beforeEach(context: BeforeEach): Unit

Runs before each individual test case. An error in this method aborts the test case.

Runs before each individual test case. An error in this method aborts the test case.

Inherited from:
Suite
Source:
Suite.scala
def checkAll(options: TestOptions, ruleSet: RuleSet)(implicit loc: Location): Unit
Inherited from:
DisciplineSuite
Source:
DisciplineSuite.scala
def checkAll(name: String, ruleSet: RuleSet)(implicit loc: Location): Unit
Inherited from:
DisciplineSuite
Source:
DisciplineSuite.scala
def clue[T](c: Clue[T]): T
Inherited from:
Assertions
Source:
Assertions.scala
def clues(clue: Clue[_]*): Clues
Inherited from:
Assertions
Source:
Assertions.scala
inline def compileErrors(inline code: String): String
Inherited from:
CompileErrorMacro
Source:
MacroCompat.scala
def fail(message: String, clues: Clues)(implicit loc: Location): Nothing
Inherited from:
Assertions
Source:
Assertions.scala
def fail(message: String, cause: Throwable)(implicit loc: Location): Nothing
Inherited from:
Assertions
Source:
Assertions.scala
def failComparison(message: String, obtained: Any, expected: Any, clues: Clues)(implicit loc: Location): Nothing
Inherited from:
Assertions
Source:
Assertions.scala
def failSuite(message: String, clues: Clues)(implicit loc: Location): Nothing
Inherited from:
Assertions
Source:
Assertions.scala
def intercept[T <: Throwable](body: => Any)(implicit T: ClassTag[T], loc: Location): T
Inherited from:
Assertions
Source:
Assertions.scala
def interceptIO[T <: Throwable](io: IO[Any])(implicit T: ClassTag[T], loc: Location): IO[T]

Intercepts a Throwable being thrown inside the provided IO.

Intercepts a Throwable being thrown inside the provided IO.

Example:
 val io = IO.raiseError[Unit](MyException("BOOM!"))
 interceptIO[MyException](io)

or

 interceptIO[MyException] {
     IO.raiseError[Unit](MyException("BOOM!"))
 }
Inherited from:
CatsEffectAssertions
Source:
CatsEffectAssertions.scala
def interceptMessage[T <: Throwable](expectedExceptionMessage: String)(body: => Any)(implicit T: ClassTag[T], loc: Location): T
Inherited from:
Assertions
Source:
Assertions.scala
def interceptMessageIO[T <: Throwable](expectedExceptionMessage: String)(io: IO[Any])(implicit T: ClassTag[T], loc: Location): IO[T]

Intercepts a Throwable with a certain message being thrown inside the provided IO.

Intercepts a Throwable with a certain message being thrown inside the provided IO.

Example:
 val io = IO.raiseError[Unit](MyException("BOOM!"))
 interceptIO[MyException]("BOOM!")(io)

or

 interceptIO[MyException] {
     IO.raiseError[Unit](MyException("BOOM!"))
 }
Inherited from:
CatsEffectAssertions
Source:
CatsEffectAssertions.scala
def interceptMessageSyncIO[T <: Throwable](expectedExceptionMessage: String)(io: SyncIO[Any])(implicit T: ClassTag[T], loc: Location): SyncIO[T]

Intercepts a Throwable with a certain message being thrown inside the provided SyncIO.

Intercepts a Throwable with a certain message being thrown inside the provided SyncIO.

Example:
 val io = SyncIO.raiseError[Unit](MyException("BOOM!"))
 interceptSyncIO[MyException]("BOOM!")(io)

or

 interceptSyncIO[MyException] {
     SyncIO.raiseError[Unit](MyException("BOOM!"))
 }
Inherited from:
CatsEffectAssertions
Source:
CatsEffectAssertions.scala
def interceptSyncIO[T <: Throwable](io: SyncIO[Any])(implicit T: ClassTag[T], loc: Location): SyncIO[T]

Intercepts a Throwable being thrown inside the provided SyncIO.

Intercepts a Throwable being thrown inside the provided SyncIO.

Example:
 val io = SyncIO.raiseError[Unit](MyException("BOOM!"))
 interceptSyncIO[MyException](io)

or

 interceptSyncIO[MyException] {
     SyncIO.raiseError[Unit](MyException("BOOM!"))
 }
Inherited from:
CatsEffectAssertions
Source:
CatsEffectAssertions.scala
Inherited from:
SuiteTransforms
Source:
SuiteTransforms.scala
Inherited from:
Assertions
Source:
Assertions.scala
def munitCaptureClues[T](thunk: => T): (T, Clues)
Inherited from:
Assertions
Source:
Assertions.scala
Inherited from:
TestTransforms
Source:
TestTransforms.scala
override def munitFlakyOK: Boolean
Inherited from:
TestTransforms
Source:
TestTransforms.scala
Inherited from:
ValueTransforms
Source:
ValueTransforms.scala
Inherited from:
SuiteTransforms
Source:
SuiteTransforms.scala
Inherited from:
SuiteTransforms
Source:
SuiteTransforms.scala
Inherited from:
SuiteTransforms
Source:
SuiteTransforms.scala
def munitPrint(clue: => Any): String
Inherited from:
Assertions
Source:
Assertions.scala
final def munitSuiteTransform(tests: List[Test]): List[Test]
Inherited from:
SuiteTransforms
Source:
SuiteTransforms.scala
Inherited from:
SuiteTransforms
Source:
SuiteTransforms.scala
final def munitTestTransform(test: Test): Test
Inherited from:
TestTransforms
Source:
TestTransforms.scala
Definition Classes
ScalaCheckSuite -> TestTransforms
Inherited from:
ScalaCheckSuite
Source:
ScalaCheckSuite.scala
def munitTests(): Seq[Test]
Inherited from:
FunSuite
Source:
FunSuite.scala
Inherited from:
FunSuite
Source:
FunSuite.scala
final def munitValueTransform(testValue: => Any): Future[Any]
Inherited from:
ValueTransforms
Source:
ValueTransforms.scala
def property(options: TestOptions)(body: => Prop)(implicit loc: Location): Unit
Inherited from:
ScalaCheckSuite
Source:
ScalaCheckSuite.scala
def property(name: String)(body: => Prop)(implicit loc: Location): Unit
Inherited from:
ScalaCheckSuite
Source:
ScalaCheckSuite.scala
def resourceSuiteFixture[A](name: String, resource: Resource[IO, A]): Fixture[A]
Inherited from:
ScalaCheckSuite
Source:
ScalaCheckSuite.scala
Inherited from:
ScalaCheckSuite
Source:
ScalaCheckSuite.scala
Inherited from:
ScalaCheckSuite
Source:
ScalaCheckSuite.scala
def test(options: TestOptions)(body: => Any)(implicit loc: Location): Unit
Inherited from:
FunSuite
Source:
FunSuite.scala
def test(name: String)(body: => Any)(implicit loc: Location): Unit
Inherited from:
FunSuite
Source:
FunSuite.scala

Inherited fields

val munitLines: Lines
Inherited from:
Assertions
Source:
Assertions.scala
final val munitTestsBuffer: ListBuffer[Test]
Inherited from:
FunSuite
Source:
FunSuite.scala

Implicits

Implicits

final implicit def ParseResultSyntax[A](self: ParseResult[A]): ParseResultSyntax[A]
implicit def saneUnitToProp(unit: Unit): Prop

Inherited implicits

Inherited from:
CatsEffectSuite
Source:
CatsEffectSuite.scala
Inherited from:
CatsEffectSuite
Source:
CatsEffectSuite.scala
implicit def testOptionsFromString(name: String)(implicit loc: Location): TestOptions

Implicitly create a TestOptions given a test name. This allows writing test("name") { ... } even if test accepts a TestOptions

Implicitly create a TestOptions given a test name. This allows writing test("name") { ... } even if test accepts a TestOptions

Inherited from:
TestOptionsConversions
Source:
TestOptions.scala