Packages

p

munit

package munit

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. munit
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. abstract class Http4sAuthedRoutesSuite[A] extends Http4sSuite[A]

    Base class for suites testing AuthedRoutes.

    Base class for suites testing AuthedRoutes.

    To use this class you'll need to provide the routes being tested by overriding routes.

    Ensure that a Show instance for the request's context type is in scope. This instance will be used to include the context's information in the test's name.

    Example:
    1. import cats.effect.IO
      
      import org.http4s.AuthedRoutes
      import org.http4s.client.dsl.io._
      import org.http4s.dsl.io._
      import org.http4s.syntax.all._
      
      class MyAuthedRoutesSuite extends munit.Http4sAuthedRoutesSuite[String] {
      
       override val routes: AuthedRoutes[String, IO] = AuthedRoutes.of {
         case GET -> Root / "hello" as user => Ok(user + " says Hi")
       }
      
       test(GET(uri"hello").as("Jose")) { response =>
         assertIO(response.as[String], "Jose says Hi")
       }
      
      }
  2. abstract class Http4sHttpRoutesSuite extends Http4sSuite[Unit]

    Base class for suites testing HttpRoutes.

    Base class for suites testing HttpRoutes.

    To use this class you'll need to provide the routes being tested by overriding routes.

    Example:
    1. import cats.effect.IO
      
      import org.http4s.HttpRoutes
      import org.http4s.client.dsl.io._
      import org.http4s.dsl.io._
      import org.http4s.syntax.all._
      
      class MyHttpRoutesSuite extends munit.Http4sHttpRoutesSuite[String] {
      
       override val routes: HttpRoutes[IO] = HttpRoutes.of {
         case GET -> Root / "hello" => Ok("Hello!")
       }
      
       test(GET(uri"hello")) { response =>
         assertIO(response.as[String], "Hello!")
       }
      
      }
  3. final case class Http4sMUnitConfig(repetitions: Option[Int], maxParallel: Option[Int]) extends Product with Serializable

    Test's configuration.

    Test's configuration.

    repetitions

    number of times a test must be repeated

    maxParallel

    maximum number of repetitions to run in parallel

  4. abstract class Http4sSuite[A] extends CatsEffectSuite

    Base class for all of the other suites using http4s' requests to test HTTP servers/routes.

  5. abstract class HttpSuite extends Http4sSuite[Unit] with CatsEffectFunFixtures

    Base class for suites testing remote HTTP servers.

    Base class for suites testing remote HTTP servers.

    To use this class you'll need to provide the Uri of the remote container by overriding baseUri.

    Example:
    1. import io.circe.Json
      
      import org.http4s.Method.GET
      import org.http4s.Uri
      import org.http4s.circe._
      import org.http4s.client.dsl.io._
      import org.http4s.syntax.all._
      
      class HttpSuiteSuite extends munit.HttpSuite {
      
       override def baseUri(): Uri = uri"https://api.github.com"
      
       test(GET(uri"users/gutiory")) { response =>
         assertEquals(response.status.code, 200)
      
         val result = response.as[Json].map(_.hcursor.get[String]("login"))
      
         assertIO(result, Right("gutiory"))
       }
      
      }

Value Members

  1. val Fail: Tag
  2. val Flaky: Tag
  3. val Ignore: Tag
  4. val Only: Tag
  5. val Slow: Tag
  6. object Http4sMUnitConfig extends Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped