Joe Test Tool API (joe.test
)
This package defines the test assertions and checkers that are available
for use in joe test
test suites.
- assertEquals(got, expected)
- assertError(callable, [message], [frames...])
- assertFalse(condition)
- assertTrue(condition)
- check(value) → ValueChecker
- checkCatch(callable) → CatchChecker
- engine() → String
- fail(message)
- skip(message)
Types
Imported Types
In addition to the APIs documented here, joe.test
includes types from
other packages so that they can be tested:
- From
joe.console
,Path
Functions
assertEquals()
assertEquals(got, expected)
Verifies that got equals the expected value, producing an informative assertion error if not.
assertError()
assertError(callable, [message], [frames...])
Executes a callable expecting it to throw an error and failing the test if it does not. The error must have the given message and stack frames, if they are provided.
When stack frames are provided, the error must include at least the provided number of frame strings, and those strings must match.
assertFalse()
assertFalse(condition)
Verifies that condition is falsey, producing an informative assertion error if not.
assertTrue()
assertTrue(condition)
Verifies that condition is truthy, producing an informative assertion error if not.
check()
check(value) → ValueChecker
Returns a checker for testing a computed value.
checkCatch()
checkCatch(callable) → CatchChecker
Executes a no-arg callable and returns a checker for checking the error result.
engine()
engine() → String
Returns the name of the engine in use, "walker" or "bert".
fail()
fail(message)
Throws an assertion error with the given message, failing the test immediately.
skip()
skip(message)
Skips the current test with the given message without executing it further. The test will be counted as "Skipped" in the final test results.