Detalhes do pacote

jest-snapshot-parser

ikatyang2.6kMIT1.0.0

parse jest snapshot content (*.snap file)

jest, jest-snapshot, parse, snap

readme (leia-me)

jest-snapshot-parser

npm build coverage

parse jest snapshot content (*.snap file)

Changelog

Install

# using npm
npm install --save jest-snapshot-parser

# using yarn
yarn add jest-snapshot-parser

Usage

import { readFileSync } from 'fs';
import { parse } from 'jest-snapshot-parser';

const snap_content = readFileSync('path/to/your/snap/file', 'utf8');
parse(snap_content); //=> JSON from *.snap file

NOTE: Only support snapshots that their original values are primitive types.

API

function parse(content: string): { [key: string]: undefined | null | boolean | number | string };

Development

# lint
yarn run lint

# build
yarn run build

# test
yarn run test

License

MIT © Ika

changelog (log de mudanças)

Change Log

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

1.0.0 (2017-08-24)

Features