Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beforeEach(() => {
percy.createBuild.mockClear();
percy.createSnapshot.mockClear();
percy.finalizeBuild.mockClear();
percy.finalizeSnapshot.mockClear();
percy.uploadResources.mockClear();
});
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);
};