Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('creates snapshots for each test case', () => {
expect(percy.createSnapshot.mock.calls).toMatchSnapshot();
});
it('handles ES6 webpack configs', async () => {
await run(['--config', 'webpack/webpack.config.babel.js']);
expect(percy.createSnapshot).toHaveBeenCalledTimes(3);
});
const expectPercyToHaveRunSnapshots = () => {
const expectedSnapshots = 6;
expect(percy.createBuild).toHaveBeenCalledTimes(1);
expect(percy.uploadResources).toHaveBeenCalledTimes(1);
expect(percy.createSnapshot).toHaveBeenCalledTimes(expectedSnapshots);
expect(percy.finalizeSnapshot).toHaveBeenCalledTimes(expectedSnapshots);
expect(percy.finalizeBuild).toHaveBeenCalledTimes(1);
};
beforeEach(() => {
percy.createBuild.mockClear();
percy.createSnapshot.mockClear();
percy.finalizeBuild.mockClear();
percy.finalizeSnapshot.mockClear();
percy.uploadResources.mockClear();
});