Jest snapshot serializer for THREE objects
$ 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();