Skip to content
SPECIFICTION
Get listed

@hapi/lab

hapi.dev

Visit hapi.dev
Spec score 7.0 #20 of 23 in JavaScript Testing Frameworks

Spec sheet

Purpose
@hapi/lab is a test utility for Node.js.Read 8 Oct 2026 · hapi.dev
Support
The hapi support page says free help is available through GitHub issues, Discord, and Slack.Read 8 Oct 2026 · hapi.dev
Assertions
Lab works best with the @hapi/code assertion library, but can be used with any assertion library that throws when a condition is not met.Read 8 Oct 2026 · hapi.dev
Compatibility
The page lists Node.js 16 or newer for major versions 25 and 26, with a BSD license.Read 4 Oct 2026 · hapi.dev
Compatibility and license
The page lists versions 26 and 25 as BSD-licensed and compatible with Node.js 16 or later.Read 8 Oct 2026 · hapi.dev
Coverage
Lab can measure code coverage and enforce a minimum coverage threshold.Read 8 Oct 2026 · hapi.dev
Coverage and reports
Lab supports code coverage and console, HTML, JSON, JUnit XML, TAP, LCOV, and Clover XML reporters.Read 4 Oct 2026 · hapi.dev
Design
Lab uses async/await and aims to keep its execution engine simple rather than build an extensible framework.Read 4 Oct 2026 · hapi.dev
Ecosystem
The project says Lab was designed to work with the hapi framework and its components, and also works with other frameworks or on its own.Read 4 Oct 2026 · github.com
Installation
The documented installation commands use npm, Yarn, or pnpm to add @hapi/lab to a project.Read 8 Oct 2026 · hapi.dev
Reporters
Built-in reporters include console, HTML, JSON, JUnit XML, TAP, LCOV, and Clover XML.Read 8 Oct 2026 · hapi.dev
Security reporting
The hapi security policy asks people to report suspected security issues with hapi modules privately to [email protected] rather than opening public issues.Read 4 Oct 2026 · hapi.dev
Test formats
Lab supports BDD-style describe/it and TDD-style suite/test interfaces.Read 8 Oct 2026 · hapi.dev
Test organization
Tests can be grouped into experiments with before, after, beforeEach, and afterEach setup and cleanup hooks.Read 8 Oct 2026 · hapi.dev
Test style
Lab uses async/await and describes its execution engine as deliberately simple rather than an extensible framework.Read 8 Oct 2026 · hapi.dev
TypeScript
Lab includes TypeScript definitions and has a CLI option to run TypeScript test files using the project’s TypeScript module and configuration.Read 8 Oct 2026 · hapi.dev

Where Specifiction places it

Alternatives to @hapi/labAll alternatives →