munit
package munit
- Alphabetic
- By Inheritance
- munit
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- class AfterEach extends Serializable
-
abstract
class
AnyFixture[T] extends AnyRef
AnyFixture allows you to acquire resources during setup and clean up resources after the tests finish running.
AnyFixture allows you to acquire resources during setup and clean up resources after the tests finish running.
Fixtures can be local to a single test case by overriding
beforeEach
andafterEach
, or they can be re-used for an entire test suite by extendingbeforeAll
andafterAll
.It's preferable to use a sub-class like
munit.Fixture
ormunit.FutureFixture
instead of this class. Extend this class if you're writing an integration a third-party type like CatsResource
.- See also
https://scalameta.org/munit/docs/fixtures.html
- trait Assertions extends CompileErrorMacro
- trait BaseFunSuite extends Suite with Assertions with FunFixtures with TestOptionsConversions with TestTransforms with SuiteTransforms with ValueTransforms
- class BeforeEach extends Serializable
- class Clue[+T] extends Serializable
- class Clues extends AnyRef
-
trait
Compare[A, B] extends AnyRef
A type-class that is used to compare values in MUnit assertions.
A type-class that is used to compare values in MUnit assertions.
By default, uses == and allows comparison between any two types as long they have a supertype/subtype relationship. For example:
- Compare[T, T] OK - Compare[Some[Int], Option[Int]] OK, subtype - Compare[Option[Int], Some[Int]] OK, supertype - Compare[List[Int], collection.Seq[Int]] OK, subtype - Compare[List[Int], Vector[Int]] Error, requires upcast to
Seq[Int]
- Annotations
- @implicitNotFound( ... )
-
trait
ComparePriority1 extends ComparePriority2
Allows comparison between A and B when A is a subtype of B
-
trait
ComparePriority2 extends AnyRef
Allows comparison between A and B when B is a subtype of A.
Allows comparison between A and B when B is a subtype of A.
This implicit is defined separately from ComparePriority1 in order to avoid diverging implicit search when comparing equal types.
-
class
ComparisonFailException extends ComparisonFailure with FailExceptionLike[ComparisonFailException]
The base exception for all comparison failures.
The base exception for all comparison failures.
This class exists so that it can extend
org.junit.ComparisonFailure
, which is recognised by IntelliJ so that users can optionally compare the obtained/expected values in a GUI diff explorer. - class FailException extends AssertionError with FailExceptionLike[FailException]
-
trait
FailExceptionLike[T <: AssertionError] extends Serializable
The base class for all MUnit FailExceptions.
The base class for all MUnit FailExceptions.
Implementation note: this class exists so that we could fix the issue https://youtrack.jetbrains.com/issue/SCL-18255 In order to support the JUnit comparison GUI in IntelliJ we need to extend org.junit.ComparisonFailure, which is a class and not an interface. We can't make
munit.FailException
extendorg.junit.ComparisonFailure
since not all "fail exceptions" are "comparison failures". Instead, we introducedmunit.ComparisionFailException
, which extendsorg.junit.ComparisonFailure
and this base trait. Internally, MUnit should match againstFailExceptionLike[_]
instead ofmunit.FailException
directly. - class FailSuiteException extends FailException
-
abstract
class
Fixture[T] extends AnyFixture[T]
Fixture allows you to acquire resources during setup and clean up resources after the tests finish running.
Fixture allows you to acquire resources during setup and clean up resources after the tests finish running.
Fixtures can be local to a single test case by overriding
beforeEach
andafterEach
, or they can be re-used for an entire test suite by extendingbeforeAll
andafterAll
.There is no functional difference between extending
Fixture[T]
orAnyFixture[T]
. The only difference is that an IDE will auto-completeUnit
in the result type instead ofAny
.- See also
https://scalameta.org/munit/docs/fixtures.html
- class Framework extends JUnitFramework
- trait FunFixtures extends AnyRef
- abstract class FunSuite extends Suite with BaseFunSuite
-
abstract
class
FutureFixture[T] extends AnyFixture[T]
FutureFixture allows you to acquire resources during setup and clean up resources after the tests finish running.
FutureFixture allows you to acquire resources during setup and clean up resources after the tests finish running.
Fixtures can be local to a single test case by overriding
beforeEach
andafterEach
, or they can be re-used for an entire test suite by extendingbeforeAll
andafterAll
.There is no functional difference between extending
FutureFixture[T]
orAnyFixture[T]
. The only difference is that an IDE will auto-completeFuture[Unit]
in the result type instead ofAny
.- See also
https://scalameta.org/munit/docs/fixtures.html
- class IgnoreSuite extends Annotation
- final class Location extends Annotation with Serializable
- class MUnitRunner extends Runner with Filterable with Configurable
-
trait
PlatformSuite extends AnyRef
- Annotations
- @EnableReflectiveInstantiation()
-
trait
Printable extends AnyRef
Override this class to customize the default pretty-printer.
-
trait
Printer extends AnyRef
Implement this trait to customize the default printer
-
abstract
class
Suite extends PlatformSuite
The base class for all test suites.
The base class for all test suites. Extend this class if you don't need the functionality in FunSuite.
- Annotations
- @RunWith( cls = classOf[MUnitRunner] )
- trait SuiteTransforms extends AnyRef
- class Tag extends munit.internal.junitinterface.Tag with Annotation with Serializable
-
final
class
Test extends Serializable
Metadata about a single test case.
-
final
class
TestOptions extends Serializable
Options used when running a test.
Options used when running a test. It can be built implicitly from a String (@see munit.TestOptionsConversions)
- trait TestOptionsConversions extends AnyRef
- trait TestTransforms extends AnyRef
- trait ValueTransforms extends AnyRef
-
type
GenericAfterEach[T] = AfterEach
- Annotations
- @deprecated
- Deprecated
(Since version 1.0.0) use AfterEach instead
-
type
GenericBeforeEach[T] = BeforeEach
- Annotations
- @deprecated
- Deprecated
(Since version 1.0.0) use BeforeEach instead
-
type
GenericTest[T] = Test
- Annotations
- @deprecated
- Deprecated
(Since version 1.0.0) use Test instead
Value Members
- val Fail: Tag
- val Flaky: Tag
- val Ignore: Tag
- val Only: Tag
- val Slow: Tag
- object Assertions extends Assertions
- object Clue extends ClueMacro with Serializable
- object Clues
- object Compare extends ComparePriority1
-
object
EmptyPrinter extends Printer
Default printer that does not customize the pretty-printer
- object Exceptions
- object Location extends LocationMacro with Serializable
- object MUnitRunner
- object Printer
- object TestOptions extends TestOptionsConversions with Serializable
-
object
TestValues
Values that have special treatment when evaluating values produced by tests.