Skip to content

Commit

Permalink
fix: remove snapshots from #26
Browse files Browse the repository at this point in the history
They are breaking in master for some unknown reason and we don't need them at all
since we can assert the right behavior.
  • Loading branch information
brunohkbx committed Sep 7, 2020
1 parent e598542 commit f0f4346
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 32 deletions.
28 changes: 0 additions & 28 deletions src/__tests__/__snapshots__/to-have-style.js.snap

This file was deleted.

6 changes: 2 additions & 4 deletions src/__tests__/to-have-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('.toHaveStyle', () => {
const container = getByTestId('container');
expect(() =>
expect(container).toHaveStyle({ backgroundColor: 'blue', transform: [{ scale: 1 }] }),
).toThrowErrorMatchingSnapshot();
).toThrowError();

This comment has been minimized.

Copy link
@philipbulley

philipbulley Sep 8, 2020

Contributor

Hi @brunohkbx, that's a shame that there's an unknown problem capturing snapshots on master. But I'm not sure I agree with your commit comment:

"we don't need them at all"

By removing this without providing an alternative, we've now lost the ability to test the diff output returned by expectedDiff which could now return Hello world! and the tests would still pass. This is quite important functionality as it's key feedback users rely on when a test fails.

This comment has been minimized.

Copy link
@brunohkbx

brunohkbx Sep 8, 2020

Author Collaborator

@philipbulley Oh, I see. I totally forgot about the nested diff 🤦‍♂️
I've downloaded your branch and the tests ran fine, not sure why it broke on master. Would you mind opening a PR for that again?

This comment has been minimized.

Copy link
@philipbulley

philipbulley Sep 14, 2020

Contributor

Sure thing... #42

expect(() => expect(container).toHaveStyle({ fontWeight: 'bold' })).toThrowError();
expect(() => expect(container).not.toHaveStyle({ color: 'black' })).toThrowError();
});
Expand Down Expand Up @@ -83,8 +83,6 @@ describe('.toHaveStyle', () => {
);

const container = getByTestId('container');
expect(() =>
expect(container).toHaveStyle({ transform: [{ scale: 1 }] }),
).toThrowErrorMatchingSnapshot();
expect(() => expect(container).toHaveStyle({ transform: [{ scale: 1 }] })).toThrowError();
});
});

0 comments on commit f0f4346

Please sign in to comment.