Extract Aphrodite-management test code to testUtil (#99)
Summary: Any tests that render Aphrodite-styled React elements will need to do this, so it’s nice to have the code in one place. wchargin-branch: aphrodite-testutils
This commit is contained in:
parent
5b420c6294
commit
61624a5dcf
|
@ -2,15 +2,7 @@ import React from "react";
|
|||
import ReactDOM from "react-dom";
|
||||
import App from "./App";
|
||||
|
||||
import {StyleSheetTestUtils} from "aphrodite/no-important";
|
||||
|
||||
beforeEach(() => {
|
||||
StyleSheetTestUtils.suppressStyleInjection();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
StyleSheetTestUtils.clearBufferAndResumeStyleInjection();
|
||||
});
|
||||
require("./testUtil").configureAphrodite();
|
||||
|
||||
// Check that PropTypes check out.
|
||||
it("renders without crashing", () => {
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
import {StyleSheetTestUtils} from "aphrodite/no-important";
|
||||
|
||||
export function configureAphrodite() {
|
||||
beforeEach(() => {
|
||||
StyleSheetTestUtils.suppressStyleInjection();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
StyleSheetTestUtils.clearBufferAndResumeStyleInjection();
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue