New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@compositor/kit-snapshot

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@compositor/kit-snapshot

Jest snapshot testing utility for examples arrays

latest
npmnpm
Version
1.0.24
Version published
Maintainers
3
Created
Source

Kit Snapshot

Jest snapshot testing utility for React component library examples

npm i -D @compositor/kit-snapshot

Usage

To promote reuse of component examples for development, documentation, testing, etc. creating an examples/ folder of components can reduce boilerplate in a component libraries.

Create an examples/ folder and add component usage examples.

// examples/Button.js
import React from 'react'
import Button from '../src/Button'

export default (
  <Button>Beep</Button>
)
// examples/index.js
export { default as Button } from './Button'

Then in a test file, import the examples and pass them to the Kit snapshot utility.

import snapshotExamples from '@compositor/kit-snapshot'
import * as examples from '../examples'

snapshotExamples(examples)

MIT License

FAQs

Package last updated on 22 May 2018

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