@ggoodman/ts-lab
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Lab + TypeScript = 😍

Take the @hapi/lab you know and love and add a sprinkling of built-in TypeScript support and out comes ts-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:

  1. Out-of-the-box support for tests authored in TypeScript.
  2. Exposes an instance of @hapi/code's assertion library as the top-level expect export.
  3. Changes the optional flags arguments passed into test functions such that:
    1. It no longer exports a mutable .onCleanup property.
    2. 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.

License

See LICENSE.md.

Readme

Keywords

none

Package Sidebar

Install

npm i @ggoodman/ts-lab

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

16.9 kB

Total Files

12

Last publish

Collaborators

  • filearts