From 7671dd072db568e4d3643797791fff605b36f2c3 Mon Sep 17 00:00:00 2001
From: Docusaurus bot
Use FunFixture.map2
to compose multiple fixtures into a single fixture.
// Fixture with access to two temporary files.
val files2 = FunFixture.map2(files, files)
-// files2: FunFixture[(Path, Path)] = munit.FunFixtures$FunFixture@2ed92d81
+// files2: FunFixture[(Path, Path)] = munit.FunFixtures$FunFixture@49f1677e
files2.test("two") {
case (file1, file2) =>
assertNotEquals(file1, file2)
diff --git a/docs/getting-started.html b/docs/getting-started.html
index cedb1fb8..6cd9bb82 100644
--- a/docs/getting-started.html
+++ b/docs/getting-started.html
@@ -153,13 +153,14 @@
-Test Prefix
+Test Prefix Comment See Also
-Success +
-Failed ==> X
-Ignored ==> i
-Skipped ==> s
+Success +
+Failed ==> X
Writing assertions
+Ignored ==> i
ignored
Filtering tests
+Pending ==> i
PENDING
Declaring tests
+Skipped ==> s
Filtering tests
Knowing these prefixes may come in handy for example when browsing test logs in
diff --git a/docs/scalatest.html b/docs/scalatest.html
index 179fd9a8..eef1c93b 100644
--- a/docs/scalatest.html
+++ b/docs/scalatest.html
@@ -92,6 +92,11 @@
+ test("ignored".ignore) {
// unchanged
}
+
+- test("pending") (pending)
++ test("pending".pending) {
++ // zero or more assertions
++ }
If you are coming from WordSpec
style tests, make sure to flatten them, or your tests
will not run: Only the outer test will be selected to run, and the inner tests will do
diff --git a/docs/tests.html b/docs/tests.html
index 3074c612..7f6982b6 100644
--- a/docs/tests.html
+++ b/docs/tests.html
@@ -335,6 +335,47 @@
Use .pending
to annotate a work-in-progress test case with known-incomplete coverage.
+Any assertions in the pending case must pass, but will be reported as Ignored instead of Success.
+Any failures will be reported as Failures (this differs from .ignore
which skips the test case entirely).
+This tag is useful for documenting:
You can (optionally) include a comment for your pending test case, such as a job ticket ID:
+ // Empty placeholder, without logged comments:
+ test("time travel".pending) {
+ // Test case to be written yesterday
+ }
+
+ // Empty placeholder, with logged comments:
+ test("time travel".pending("requirements from product owner")) {
+ // Is this funded yet??
+ }
+
+ // Empty placeholder, tracked for action:
+ test("time travel".pending("INTERN-101")) {
+ // Test case to be written by an intern
+ }
+
+ // Incomplete (WIP) placeholder, tracked for action:
+ test("time travel".pending("QA-404")) {
+ assert(LocalDate.now.isAfter(yesterday))
+ // QA team to provide specific examples for regression-test coverage
+ }
+
+If you want to mark a failed regression test as pending-until-fixed,
+you combine .ignore
before or after .pending
, for example:
test("this test worked yesterday".ignore.pending("platform investigation")) {
+ assert(LocalDate.now.equals(yesterday))
+ }
+
+This allows pending comments, reasons, or cross-references to be logged for ignored tests.
Use .flaky
to mark a test case that has a tendency to non-deterministically
fail for known or unknown reasons.