MCPcopy
hub / github.com/adobe/react-spectrum / act

Function act

packages/@react-aria/test-utils/src/act.ts:23–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23export const act: typeof actImpl = fn => {
24 // only wrap in act if in test environment, breaks vite browser test if test utils are used otherwise
25 if (
26 // @ts-ignore
27 typeof IS_REACT_ACT_ENVIRONMENT === 'boolean'
28 ? // @ts-ignore
29 IS_REACT_ACT_ENVIRONMENT
30 : typeof jest !== 'undefined'
31 ) {
32 return actImpl(fn);
33 }
34 return fn();
35};

Callers 15

domHelpers.test.jsFile · 0.90
ComboBox.test.jsFile · 0.90
Toolbar.test.tsxFile · 0.90
AriaAutocompleteTestsFunction · 0.90
filterTestsFunction · 0.90
AriaMenuTestsFunction · 0.90
AriaTreeTestsFunction · 0.90
Checkbox.test.jsFile · 0.90
Calendar.test.jsFile · 0.90
Toolbar.test.tsxFile · 0.90
Form.test.jsFile · 0.90

Calls 1

fnFunction · 0.85

Tested by 15

renderFunction · 0.72
rerenderFunction · 0.72
resizeColFunction · 0.72
resizeTableFunction · 0.72
verifyMenuToggleFunction · 0.72
openAndTriggerMenuItemFunction · 0.72
AppFunction · 0.72
InnerFunction · 0.68
InnerFunction · 0.68
ExampleFunction · 0.68
ExampleComponentFunction · 0.68
testKeyboardFunction · 0.68