@ggoodman/ts-lab
v1.0.3
Published
An opinionated wrapper over @hapi/lab with typescript and disposables support
Downloads
15
Readme
Lab + TypeScript = 😍
Take the
@hapi/lab
you know and love and add a sprinkling of built-in TypeScript support and out comests-lab
, an opinionated spin on vanilla lab.
See @hapi/lab on the official Hapi developer site for more information on Lab itself.
Differences
ts-lab
is not a fork of @hapi/lab
but instead wraps it. At the time of writing, the justification for this decision isn't entirely clear but here we are. This repo exposes a binary ts-lab
that forwards arguments to the lab
binary exposed by @hapi/lab
with the addition of arguments to add TypeScript support. The module also exposes an API that wraps @hapi/lab
's API. The differences are outlined below:
- Out-of-the-box support for tests authored in TypeScript.
- Exposes an instance of
@hapi/code
's assertion library as the top-levelexpect
export. - Changes the optional
flags
arguments passed into test functions such that:- It no longer exports a mutable
.onCleanup
property. - Exports a
.disposeOf(disposable: { dispose(): void }): void
function. This can be used to register multiple disposables for disposal during the test's clean-up phase.
- It no longer exports a mutable
License
See LICENSE.md.