munit

package munit

Type members

Classlikes

object Assertions extends Assertions
Companion
class
Companion
object
class Clue[+T](val source: String, val value: T, val valueType: String) extends Serializable
Companion
object
object Clue extends ClueMacro
Companion
class
class Clues(val values: List[Clue[_]])
class ComparisonFailException(val message: String, val obtained: Any, val expected: Any, val location: Location) 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.

Value Params
expected

the expected value from this comparison.

location

the source location where this exception was thrown.

message

the exception message.

obtained

the obtained value from this comparison.

object EmptyPrinter extends Printer

Default printer that does not customize the pretty-printer

Default printer that does not customize the pretty-printer

class FailException(val message: String, val cause: Throwable, val isStackTracesEnabled: Boolean, val location: Location) extends AssertionError with FailExceptionLike[FailException] with Serializable
trait FailExceptionLike[T <: AssertionError]

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 extend org.junit.ComparisonFailure since not all "fail exceptions" are "comparison failures". Instead, we introduced munit.ComparisionFailException, which extends org.junit.ComparisonFailure and this base trait. Internally, MUnit should match against FailExceptionLike[_] instead of munit.FailException directly.

class FailSuiteException(val message: String, val location: Location) extends FailException
class Framework extends JUnitFramework
class GenericAfterEach[T](val test: GenericTest[T]) extends Serializable
class GenericBeforeEach[T](val test: GenericTest[T]) extends Serializable
class GenericTest[T](val name: String, val body: () => T, val tags: Set[Tag], val location: Location) extends Serializable

Metadata about a single test case.

Metadata about a single test case.

Value Params
body

the function to be evaluated for this test case.

location

the file and line number where this test was defined.

tags

the annotated tags for this test case.

class IgnoreSuite extends Annotation
object Location extends LocationMacro
Companion
class
final class Location(val path: String, val line: Int) extends Annotation with Serializable
Companion
object
class MUnitRunner(val cls: Class[_ <: Suite], newInstance: () => Suite) extends Runner with Filterable with Configurable
Companion
object
object MUnitRunner
Companion
class
@EnableReflectiveInstantiation
trait Printable

Override this class to customize the default pretty-printer.

Override this class to customize the default pretty-printer.

trait Printer

Implement this trait to customize the default printer

Implement this trait to customize the default printer

@RunWith(scala.Predef.classOf[munit.MUnitRunner])
abstract class Suite extends PlatformSuite

The base class for all test suites. Extend this class if you don't need the functionality in FunSuite.

The base class for all test suites. Extend this class if you don't need the functionality in FunSuite.

class Tag(val value: String) extends Tag with Annotation with Serializable
final class TestOptions(val name: String, val tags: Set[Tag], val location: Location) extends Serializable

Options used when running a test. It can be built implicitly from a String (@see munit.TestOptionsConversions)

Options used when running a test. It can be built implicitly from a String (@see munit.TestOptionsConversions)

Value Params
name

the test name, used in the UI and to select it with testOnly

tags

a set of munit.Tag, used to attach semantic information to a test

Companion
object
Companion
class
object TestValues

Values that have special treatment when evaluating values produced by tests.

Values that have special treatment when evaluating values produced by tests.

Value members

Concrete fields

val Fail: Tag
val Flaky: Tag
val Ignore: Tag
val Only: Tag
val Slow: Tag