项目作者: dbkaplun

项目描述 :
Jest snapshot serializer for THREE objects
高级语言: JavaScript
项目地址: git://github.com/dbkaplun/three-snapshot-serializer.git
创建时间: 2018-05-14T16:07:42Z
项目社区:https://github.com/dbkaplun/three-snapshot-serializer

开源协议:MIT License

下载


three-snapshot-serializer

Jest snapshot serializer for THREE objects

Usage

  1. $ npm install three-snapshot-serializer --save-dev

To use for all test files, add the following to package.json:

  1. {
  2. "jest": {
  3. "snapshotSerializers": ["three-snapshot-serializer"]
  4. }
  5. }

To use in one test file:

  1. import { createSerializer } from 'three-snapshot-serializer';
  2. expect.addSnapshotSerializer(createSerializer({ dropUUIDs: true }));

To use in one assertion:

  1. import { toJSON } from 'three-snapshot-serializer';
  2. expect(toJSON(obj)).matchesSnapshot();