Skip to content

Commit

Permalink
Mention node:test in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszradomski committed Jun 10, 2024
1 parent 530bf06 commit 2f5e0fc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
14 changes: 14 additions & 0 deletions packages/website/docs/guides/snapshot-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,17 @@ test('foo matches snapshot', (ctx) => {

test.run()
```

## Usage with node:test

```ts
import { expect } from 'earl'
import { describe, it } from 'node:test'

test('foo matches snapshot', (ctx) => {
// Here we pass the `ctx` as test context
expect('foo').toMatchSnapshot(ctx)
})

test.run()
```
7 changes: 4 additions & 3 deletions packages/website/docs/introduction/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ editLink: true

Earl is an ergonomic, modern and type-safe assertion library written in
TypeScript. You might be familiar with similar libraries like: _chai_ or
_assert_. Earl should be used with a test runner like _mocha_ or _uvu_.
_assert_. Earl should be used with a test runner like _mocha_, _uvu_ or
_node:test_.

To install Earl run:

Expand Down Expand Up @@ -128,8 +129,8 @@ for information on how to configure your project fully.

## Installing mocha

**Earl** is designed to be used with a test runner like _mocha_ or _uvu_. In
this tutorial we're going to use mocha.
**Earl** is designed to be used with a test runner like _mocha_, _uvu_ or
_node:test_. In this tutorial we're going to use mocha.

We could install just mocha, but we're going to grab a few more packages to
help us work with TypeScript.
Expand Down

0 comments on commit 2f5e0fc

Please sign in to comment.