JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1406
  • Score
    100M100P100Q108259F
  • License MIT

Snapshot testing plugin for Japa

Package Exports

  • @japa/snapshot

Readme

@japa/snapshot

Snapshot testing plugin for Japa

gh-workflow-image npm-image license-image snyk-image

Snapshot testing plugin for Japa. This plugin allows you to write snapshot tests for your application.

Complete API documentation

Installation

Install the package from the npm registry as follows:

npm i @japa/snapshot

pnpm i @japa/snapshot

yarn add @japa/snapshot

Usage

You can use this package with the @japa/runner as follows.

import { snapshot } from '@japa/snapshot'
import { configure } from '@japa/runner'

configure({
  plugins: [snapshot()],
})

Once done, you will be able to access the snapshot property on the test context.

test('test title', ({ snapshot }) => {
  snapshot.expect('hello').toMatchSnapshot()
})