Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dbkaplun/three-snapshot-serializer
Jest snapshot serializer for THREE objects
https://github.com/dbkaplun/three-snapshot-serializer
json serializer snapshot threejs
Last synced: about 1 month ago
JSON representation
Jest snapshot serializer for THREE objects
- Host: GitHub
- URL: https://github.com/dbkaplun/three-snapshot-serializer
- Owner: dbkaplun
- License: mit
- Created: 2018-05-14T16:07:42.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-01T22:38:33.000Z (almost 2 years ago)
- Last Synced: 2024-12-18T07:18:54.734Z (about 2 months ago)
- Topics: json, serializer, snapshot, threejs
- Language: JavaScript
- Size: 187 KB
- Stars: 4
- Watchers: 3
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# three-snapshot-serializer
Jest snapshot serializer for THREE objects## Usage
```sh
$ npm install three-snapshot-serializer --save-dev
```To use for all test files, add the following to package.json:
```json
{
"jest": {
"snapshotSerializers": ["three-snapshot-serializer"]
}
}
```To use in one test file:
```js
import { createSerializer } from 'three-snapshot-serializer';expect.addSnapshotSerializer(createSerializer({ dropUUIDs: true }));
```To use in one assertion:
```js
import { toJSON } from 'three-snapshot-serializer';expect(toJSON(obj)).matchesSnapshot();
```