import React from 'react' ; import { TestComponentProps , TestRunner } from '../TestRunner' ; import { buttonStyles , buttonVariants } from '../utils/buttonStyles' ; import { styled } from '../utils/stitches-react-v025.config' ; const Button = styled ( 'button' , { ... ( buttonStyles as any ) , ... ( buttonVariants as any ) , } ) ; const Test = ( { testIndex } ) => { const variants = { variant : testIndex % 2 === 0 ? 'red' : 'blue' , size : testIndex % 2 === 0 ? '1' : '2' , } ; return < Button { ... variants } > testing < /Button>; } ; const StitchesTest = ( ) => { return ( < > < TestRunner numberOfRuns = { 3 } iterationN = { 1000 } TestComponent = { Test } / > < div style = { { opacity : 0 , pointerEvents : 'none' } } > < Button > we mount the button outside the test to make sure we 're not clocking any mount time</Button> < /div> < />); } ; export default StitchesTest ;