Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jest-specific-snapshot

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-specific-snapshot

[![CircleCI](https://circleci.com/gh/igor-dv/jest-specific-snapshot.svg?style=svg)](https://circleci.com/gh/igor-dv/jest-specific-snapshot)

  • 8.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
151K
decreased by-18.58%
Maintainers
1
Weekly downloads
 
Created

What is jest-specific-snapshot?

The jest-specific-snapshot package allows you to create and manage Jest snapshots in a more granular and specific manner. It provides functionality to create snapshots for specific tests and manage them independently, which can be useful for large test suites or when you need more control over your snapshot testing.

What are jest-specific-snapshot's main functionalities?

Creating a specific snapshot

This feature allows you to create a snapshot for a specific test and store it in a specified file. This can be useful for organizing snapshots and keeping them separate from other tests.

const { toMatchSpecificSnapshot } = require('jest-specific-snapshot');
expect.extend({ toMatchSpecificSnapshot });

test('example test', () => {
  const data = { key: 'value' };
  expect(data).toMatchSpecificSnapshot('./__snapshots__/example.snap');
});

Updating a specific snapshot

This feature allows you to update an existing snapshot for a specific test. If the snapshot already exists, it will be updated with the new data provided in the test.

const { toMatchSpecificSnapshot } = require('jest-specific-snapshot');
expect.extend({ toMatchSpecificSnapshot });

test('example test', () => {
  const data = { key: 'new value' };
  expect(data).toMatchSpecificSnapshot('./__snapshots__/example.snap');
});

Other packages similar to jest-specific-snapshot

FAQs

Package last updated on 05 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc