Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbarbara committed Jul 21, 2019
1 parent 6178602 commit 53cea92
Show file tree
Hide file tree
Showing 6 changed files with 195 additions and 663 deletions.
37 changes: 28 additions & 9 deletions test/__fixtures__/circles.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions test/__fixtures__/dots.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions test/__fixtures__/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
circle:first-child {
fill: red;
}
12 changes: 9 additions & 3 deletions test/__setup__/setupFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,16 @@ window.matchMedia = () => ({
});

const consoleError = console.error;
console.error = jest.fn(message => {
if (message instanceof InlineSVGError) {
console.error = jest.fn(error => {
const skipMessages = ['Expected `%s` listener', 'Error parsing input'];

if (
error instanceof InlineSVGError ||
(typeof error === 'string' && skipMessages.some(d => error.indexOf(d) >= 0)) ||
(error instanceof Error && skipMessages.some(d => error.message.indexOf(d) >= 0))
) {
return;
}

consoleError(message);
consoleError(error);
});
Loading

0 comments on commit 53cea92

Please sign in to comment.