Container of <Test> components. Uses react context to manage the state of the tests.
<Test> components must have a <TestContainer> parent somewhere in the tree.
import { Test, TestContainer, TestGroup, expect } from "react-browser-tests";
export default function TestPage() {
return (
<TestContainer>
<Test title="Expect 1 + 1 to equal 2." fn={() => {
expect(1 + 1).to.equal(2);
}} />
</TestContainer>
);
}
If we navigate to that page, we'll see:
Function that runs before each test in the container.
Function that runs after each test in the container.
Function that runs before all tests in the container.
Function that runs after all tests in the container.
CSS styles to apply to the container's elements. The default value is a CSS string constant called testContainerStyles
, exported from the styles.ts file.
Supports standard HTMLDivElement props. For example: className
, style
, etc.