Package Exports
- jest-snapshot-parser
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jest-snapshot-parser) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
jest-snapshot-parser
parse jest snapshot content (*.snap file)
Install
# using npm
npm install --save jest-snapshot-parser
# using yarn
yarn add jest-snapshot-parserUsage
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 fileNOTE: 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 testLicense
MIT © Ika