MCPcopy Index your code
hub / github.com/nativewind/nativewind / renderCurrentTest

Function renderCurrentTest

packages/nativewind/src/test.tsx:58–81  ·  view source on GitHub ↗
({
  className = expect.getState().currentTestName?.split(/\s+/).at(-1),
  ...options
}: RenderCurrentTestOptions = {})

Source from the content-addressed store, hash-verified

56process.env.NATIVEWIND_OS = Platform.OS;
57
58export async function renderCurrentTest({
59 className = expect.getState().currentTestName?.split(/\s+/).at(-1),
60 ...options
61}: RenderCurrentTestOptions = {}) {
62 if (!className) {
63 throw new Error(
64 "unable to detect className, please manually set a className",
65 );
66 }
67
68 await render(<View testID={testID} className={className} />, options);
69 const component = screen.getByTestId(testID, { hidden: true });
70
71 // Strip the testID and the children
72 const { testID: _testID, children, ...props } = component.props;
73
74 const invalid = getInvalid();
75
76 if (invalid) {
77 return { props, invalid };
78 } else {
79 return { props };
80 }
81}
82
83renderCurrentTest.debug = (options: RenderCurrentTestOptions = {}) => {
84 return renderCurrentTest({ ...options, debugCompiled: true });

Callers 15

borders.tsxFile · 0.90
sizing.tsxFile · 0.90
backgrounds.tsxFile · 0.90
interactivity.tsxFile · 0.90
typography.tsxFile · 0.90
preset.tsxFile · 0.90
tables.tsxFile · 0.90
elevation.tsxFile · 0.90
transforms.tsxFile · 0.90
filters.tsxFile · 0.90
layout.tsxFile · 0.90

Calls 2

renderFunction · 0.90
getInvalidFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…