Skip to content

Commit 652a8f7

Browse files
committed
clean up garbage between tests
1 parent bd477db commit 652a8f7

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

test/__snapshots__/styleSheetSerializer.spec.js.snap

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -452,10 +452,6 @@ exports[`referring to other components: mount 1`] = `
452452
background-color: red;
453453
}
454454
455-
@media (max-width:600px) {
456-
457-
}
458-
459455
<styled.a
460456
href="#"
461457
>
@@ -548,10 +544,6 @@ exports[`referring to other components: react-test-renderer 1`] = `
548544
background-color: red;
549545
}
550546
551-
@media (max-width:600px) {
552-
553-
}
554-
555547
<a
556548
className="c0"
557549
href="#"
@@ -630,10 +622,6 @@ exports[`referring to other components: react-testing-library 1`] = `
630622
background-color: red;
631623
}
632624
633-
@media (max-width:600px) {
634-
635-
}
636-
637625
<a
638626
class="c0"
639627
href="#"

test/styleSheetSerializer.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import React from 'react';
44
import renderer from 'react-test-renderer';
55
import styled, { ThemeContext, ThemeProvider } from 'styled-components';
66
import '../src';
7+
import { resetStyleSheet } from '../src/utils';
78

89
const toMatchSnapshot = (name, component) => {
910
expect(renderer.create(component).toJSON()).toMatchSnapshot('react-test-renderer');
@@ -19,6 +20,10 @@ const shallowWithTheme = (tree, theme) => {
1920
return shallow(tree);
2021
};
2122

23+
beforeEach(() => {
24+
resetStyleSheet();
25+
});
26+
2227
it('null', () => {
2328
expect(null).toMatchSnapshot();
2429
});

0 commit comments

Comments
 (0)