Releases: japa/core
Add ability to reset test timeout from within the test callback
You can call the resetTimeout
method within the test callback to reset the test timeout.
test('title', ({ test: self }) => {
self.resetTimeout()
})
We might add a helper within the test context to destructure the resetTimeout
method directly
Commits
- feat: add ability to resetTimeout within the test callback 433ede5
- refactor: test timeout timer logic 10fdb34
- chore: update dependencies 9f28876
Full Changelog: v8.0.0-8...v8.0.0-9
Remove optional modifier from test.context
- refactor: remove optional modifier from test.context 79474e7
Full Changelog: v8.0.0-7...v8.0.0-8
Do not round test duration
Full Changelog: v8.0.0-6...v8.0.0-7
Add summary builder to allow multiple sources to contribute to the summary output
- feat: add summary builder for creating tests summary 1144da5
Full Changelog: v8.0.0-5...v8.0.0-6
Changes to negated tags and unhandled errors
We have removed all the code related to unhandled errors. There is no simple and correct way to find which test caused an unhandled exception or rejection. Therefore, we will monitor these errors globally and report them with pretty printed stack trace. The stack trace might help you find the related test.
Now, you can prefix your tags with tilde ~
and it will be considered as a negated tag. Earlier, the character was !
, but you will have to escape !
inside a terminal, whereas ~
needs no escaping.
Hope, everything makes sense :)
Commits
- feat: allow negated tags using the ~ character f1ba19a
- refactor: remove code related to unhandleExceptions f4fe87f
- chore: update dependencies e266ae5
Full Changelog: v8.0.0-4...v8.0.0-5
Follow up on last release. Removing references to uncaught exception event
- refactor: remove unused aggregate for uncaughtExceptions 5ebf3d0
Full Changelog: v8.0.0-3...v8.0.0-4
Remove uncaught:exception event
We will use the uncaughtException
process event directly, instead of abstracting it away.
Breaking change
- The
uncaught:exception
event does not exists anymore. - Removed
runner.managerUncaughtExceptions()
method.
Commits
- refactor: remove uncaught:exception event 1c50571
Full Changelog: v8.0.0-2...v8.0.0-3
Add static executing and executed callbacks
You can define executing
and executed
callbacks as static properties on a Test class. These callbacks are executed right before and after the test callback function.
- The callbacks have to be synchronous.
- The will be executed for all the tests created using
Test
class. - They can make a test fail by throwing an exception.
Breaking change
- The
Test.dispose
method has been replaced withTest.executed
Commits
- test: fix breaking tests dc969b5
- test: fix breaking tests d519b3e
- feat: add executing and executed static hooks and remove dispose callbacks 6711174
- chore: update dependencies 088f407
- ci: refactor workflows files 10f7949
Full Changelog: v8.0.0-1...v8.0.0-2
Remove types exported from the main entrypoint
The types can be imported using the @japa/core/types
import path
Commits
- refactor: do not export types from main module 688ad46
Full Changelog: v8.0.0-0...v8.0.0-1
Preparing for Japa@3
Breaking changes
- The package is ESM only
- The hooks types does not allow returning values except a cleanup function or void. Early
any
was allowed. This does not have any impact on the runtime behavior, the change only effects the TypeScript types.
Commits
- chore: add engines to package.json file 7cd0dd3
- feat: add support for matching all the tags 37295f5
- refactor: rename internal property for storing negated tags e6636a6
- ci: finding a way to run tests on windows c6b8659
- test: add a bin script to self execute tests 4e93bf2
- chore: add typechecking script a94e0bd
- ci: fix path to shared workflow files 29dab6c
- ci: add workflows for lint and typecheck 6b851a5
- refactor: migrate to esm and use node:test for testing 54e564f
- chore: upgrade packages and tooling config e0634fc
- chore: update dependencies c2812a0
- docs: update License file 1471e58
- chore: update dependencies 2c8b7bf
Full Changelog: v7.3.3...v8.0.0-0