ngx-jest-snapshot-serializer
Plugin that serializes Angular fixture components for Jest snapshot tests.
Install
$ npm install --save-dev ngx-jest-snapshot-serializer
Usage
For an individual test file:
;expect;
For all test files, you need to specify serializer in Jest configuration. For example, in a package.json
file:
If you do not set up jest testing in your Angular application yet then look at this preset.
Example
Example snapshot outputs could be found in the examples/
directory.
Further reading
More details about snapshot plugins could be found in Pretty format package.
Highly inspired by enzyme-to-json package.