playwright-expect-snapshot
v1.0.4
Published
A toMatchSnapshot replacement for Playwright that supports objects by sorting object keys and stringifying it.
Readme
playwright-expect-snapshot
A toMatchSnapshot replacement for Playwright that supports objects by sorting object keys and stringifying it.
Install
# npm
$ npm install playwright-expect-snapshot
# Yarn
$ yarn add playwright-expect-snapshotUsage
import { test } from '@playwright/test';
import { expect } from 'playwright-expect-snapshot';
test('works', () => expect({ foo: 'bar', bar: 'baz' }).toMatchSnapshot());Behavior
It will sort keys of an object, convert it to a JSON string and add a trailing newline for better IDE support. The behavior is similar to expect-mocha-snapshot.
Open questions
Contribute
Are you missing something or want to contribute? Feel free to file an issue or a pull request! ⚙️
Support
Hey, I am Sebastian Landwehr, a freelance web developer, and I love developing web apps and open source packages. If you want to support me so that I can keep packages up to date and build more helpful tools, you can donate here:
Thanks a lot for your support! ❤️
