Groups multiple <Test> components together. <Test> components can be used without a <TestGroup> parent.
Currently, the main uses for this component are:
import { Test, TestContainer, TestGroup, expect } from "react-browser-tests";
export default function TestPage() {
return (
<TestContainer>
<TestGroup title="Math tests">
<Test title="Expect 1 + 1 to equal 2." fn={() => {
expect(1 + 1).to.equal(2);
}} />
</TestGroup>
</TestContainer>
);
}
If we navigate to that page, we'll see the following:
Test group title.
Function that runs before each test in the test group.
Function that runs after each test in the test group.
Function that runs before all tests in the test group.
Function that runs after all tests in the test group.
Supports standard HTMLDivElement props. For example: className
, style
, etc.