Skip to content

dbkaplun/three-snapshot-serializer

Repository files navigation

three-snapshot-serializer

Jest snapshot serializer for THREE objects

Usage

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

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

{
  "jest": {
    "snapshotSerializers": ["three-snapshot-serializer"]
  }
}

To use in one test file:

import { createSerializer } from 'three-snapshot-serializer';

expect.addSnapshotSerializer(createSerializer({ dropUUIDs: true }));

To use in one assertion:

import { toJSON } from 'three-snapshot-serializer';

expect(toJSON(obj)).matchesSnapshot();

About

Jest snapshot serializer for THREE objects

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published