@react-native-harness/runtime 1.0.0-canary.1761729829908 → 1.0.0-canary.1764662948126

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/client/store.d.ts +4 -0
  2. package/dist/client/store.d.ts.map +1 -0
  3. package/dist/client/store.js +10 -0
  4. package/dist/expect/expect.d.ts +9 -0
  5. package/dist/expect/expect.d.ts.map +1 -0
  6. package/dist/expect/expect.js +77 -0
  7. package/dist/expect/matchers/toMatchImageSnapshot.d.ts +12 -0
  8. package/dist/expect/matchers/toMatchImageSnapshot.d.ts.map +1 -0
  9. package/dist/expect/matchers/toMatchImageSnapshot.js +11 -0
  10. package/dist/render/queries.d.ts +7 -0
  11. package/dist/render/queries.d.ts.map +1 -0
  12. package/dist/render/queries.js +99 -0
  13. package/dist/runner/context.d.ts +10 -0
  14. package/dist/runner/context.d.ts.map +1 -0
  15. package/dist/runner/context.js +6 -0
  16. package/dist/screen/index.d.ts +8 -0
  17. package/dist/screen/index.d.ts.map +1 -0
  18. package/dist/screen/index.js +18 -0
  19. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  20. package/dist/ui/state.d.ts +2 -2
  21. package/dist/userEvent/index.d.ts +6 -0
  22. package/dist/userEvent/index.d.ts.map +1 -0
  23. package/dist/userEvent/index.js +10 -0
  24. package/out-tsc/vitest/src/bundler/bundle.d.ts.map +1 -1
  25. package/out-tsc/vitest/src/bundler/evaluate.d.ts.map +1 -1
  26. package/out-tsc/vitest/src/client/factory.d.ts.map +1 -1
  27. package/out-tsc/vitest/src/client/setup-files.d.ts +12 -0
  28. package/out-tsc/vitest/src/client/setup-files.d.ts.map +1 -0
  29. package/out-tsc/vitest/src/client/store.d.ts +4 -0
  30. package/out-tsc/vitest/src/client/store.d.ts.map +1 -0
  31. package/out-tsc/vitest/src/collector/functions.d.ts +1 -1
  32. package/out-tsc/vitest/src/collector/functions.d.ts.map +1 -1
  33. package/out-tsc/vitest/src/collector/types.d.ts +1 -1
  34. package/out-tsc/vitest/src/collector/types.d.ts.map +1 -1
  35. package/out-tsc/vitest/src/constants.d.ts +0 -1
  36. package/out-tsc/vitest/src/constants.d.ts.map +1 -1
  37. package/out-tsc/vitest/src/expect/index.d.ts +5 -0
  38. package/out-tsc/vitest/src/expect/index.d.ts.map +1 -1
  39. package/out-tsc/vitest/src/expect/matchers/toMatchImageSnapshot.d.ts +7 -0
  40. package/out-tsc/vitest/src/expect/matchers/toMatchImageSnapshot.d.ts.map +1 -0
  41. package/out-tsc/vitest/src/index.d.ts +4 -0
  42. package/out-tsc/vitest/src/index.d.ts.map +1 -1
  43. package/out-tsc/vitest/src/jest-mock.d.ts +2 -0
  44. package/out-tsc/vitest/src/jest-mock.d.ts.map +1 -0
  45. package/out-tsc/vitest/src/render/ErrorBoundary.d.ts +17 -0
  46. package/out-tsc/vitest/src/render/ErrorBoundary.d.ts.map +1 -0
  47. package/out-tsc/vitest/src/render/TestComponentOverlay.d.ts +3 -0
  48. package/out-tsc/vitest/src/render/TestComponentOverlay.d.ts.map +1 -0
  49. package/out-tsc/vitest/src/render/cleanup.d.ts +2 -0
  50. package/out-tsc/vitest/src/render/cleanup.d.ts.map +1 -0
  51. package/out-tsc/vitest/src/render/index.d.ts +6 -0
  52. package/out-tsc/vitest/src/render/index.d.ts.map +1 -0
  53. package/out-tsc/vitest/src/render/setup.d.ts +2 -0
  54. package/out-tsc/vitest/src/render/setup.d.ts.map +1 -0
  55. package/out-tsc/vitest/src/render/types.d.ts +12 -0
  56. package/out-tsc/vitest/src/render/types.d.ts.map +1 -0
  57. package/out-tsc/vitest/src/runner/factory.d.ts.map +1 -1
  58. package/out-tsc/vitest/src/screen/index.d.ts +8 -0
  59. package/out-tsc/vitest/src/screen/index.d.ts.map +1 -0
  60. package/out-tsc/vitest/src/ui/ReadyScreen.d.ts.map +1 -1
  61. package/out-tsc/vitest/src/ui/WrongEnvironmentScreen.d.ts.map +1 -1
  62. package/out-tsc/vitest/src/ui/state.d.ts +13 -0
  63. package/out-tsc/vitest/src/ui/state.d.ts.map +1 -1
  64. package/out-tsc/vitest/src/userEvent/index.d.ts +6 -0
  65. package/out-tsc/vitest/src/userEvent/index.d.ts.map +1 -0
  66. package/out-tsc/vitest/tsconfig.spec.tsbuildinfo +1 -1
  67. package/package.json +5 -4
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ type ErrorBoundaryProps = {
3
+ children: React.ReactNode;
4
+ };
5
+ type ErrorBoundaryState = {
6
+ hasError: boolean;
7
+ error: Error | null;
8
+ };
9
+ export declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
10
+ constructor(props: ErrorBoundaryProps);
11
+ static getDerivedStateFromError(error: Error): ErrorBoundaryState;
12
+ componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
13
+ componentDidUpdate(prevProps: ErrorBoundaryProps): void;
14
+ render(): React.ReactNode;
15
+ }
16
+ export {};
17
+ //# sourceMappingURL=ErrorBoundary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../../src/render/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,KAAK,kBAAkB,GAAG;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB,CAAC;AAEF,qBAAa,aAAc,SAAQ,KAAK,CAAC,SAAS,CAChD,kBAAkB,EAClB,kBAAkB,CACnB;gBACa,KAAK,EAAE,kBAAkB;IAKrC,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,kBAAkB;IAIxD,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI;IAIjE,kBAAkB,CAAC,SAAS,EAAE,kBAAkB,GAAG,IAAI;IAOvD,MAAM,IAAI,KAAK,CAAC,SAAS;CAwBnC"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const TestComponentOverlay: () => React.ReactElement | null;
3
+ //# sourceMappingURL=TestComponentOverlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestComponentOverlay.d.ts","sourceRoot":"","sources":["../../../../src/render/TestComponentOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAMzC,eAAO,MAAM,oBAAoB,QAAO,KAAK,CAAC,YAAY,GAAG,IAgC5D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const cleanup: () => void;
2
+ //# sourceMappingURL=cleanup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleanup.d.ts","sourceRoot":"","sources":["../../../../src/render/cleanup.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,QAAO,IAI1B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import type { RenderResult, RenderOptions } from './types.js';
3
+ export declare const render: (element: React.ReactElement, options?: RenderOptions) => Promise<RenderResult>;
4
+ export { cleanup } from './cleanup.js';
5
+ export type { RenderResult, RenderOptions } from './types.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/render/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAY9D,eAAO,MAAM,MAAM,GACjB,SAAS,KAAK,CAAC,YAAY,EAC3B,UAAS,aAAkB,KAC1B,OAAO,CAAC,YAAY,CA2EtB,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const setup: () => void;
2
+ //# sourceMappingURL=setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../../src/render/setup.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK,YAIjB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type React from 'react';
2
+ export type RenderResult = {
3
+ rerender: (element: React.ReactElement) => Promise<void>;
4
+ unmount: () => void;
5
+ };
6
+ export type RenderOptions = {
7
+ timeout?: number;
8
+ wrapper?: React.ComponentType<{
9
+ children: React.ReactNode;
10
+ }>;
11
+ };
12
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/render/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE,CAAC,CAAC;CAC9D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/runner/factory.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,eAAO,MAAM,aAAa,QAAO,UAehC,CAAC"}
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/runner/factory.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,eAAO,MAAM,aAAa,QAAO,UAsBhC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { ElementReference, FileReference } from '@react-native-harness/bridge';
2
+ export type Screen = {
3
+ findByTestId: (testId: string) => Promise<ElementReference>;
4
+ findAllByTestId: (testId: string) => Promise<ElementReference[]>;
5
+ screenshot: (name?: string) => Promise<FileReference>;
6
+ };
7
+ export declare const screen: Screen;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/screen/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,aAAa,EACd,MAAM,8BAA8B,CAAC;AAGtC,MAAM,MAAM,MAAM,GAAG;IACnB,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC5D,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACjE,UAAU,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;CACvD,CAAC;AAmBF,eAAO,MAAM,MAAM,QAAiB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ReadyScreen.d.ts","sourceRoot":"","sources":["../../../../src/ui/ReadyScreen.tsx"],"names":[],"mappings":"AAcA,eAAO,MAAM,WAAW,+CAkCvB,CAAC"}
1
+ {"version":3,"file":"ReadyScreen.d.ts","sourceRoot":"","sources":["../../../../src/ui/ReadyScreen.tsx"],"names":[],"mappings":"AAaA,eAAO,MAAM,WAAW,+CAgCvB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"WrongEnvironmentScreen.d.ts","sourceRoot":"","sources":["../../../../src/ui/WrongEnvironmentScreen.tsx"],"names":[],"mappings":"AAUA,eAAO,MAAM,sBAAsB,+CAoBlC,CAAC"}
1
+ {"version":3,"file":"WrongEnvironmentScreen.d.ts","sourceRoot":"","sources":["../../../../src/ui/WrongEnvironmentScreen.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB,+CAiBlC,CAAC"}
@@ -1,7 +1,20 @@
1
+ import type React from 'react';
1
2
  export type RunnerState = {
2
3
  status: 'loading' | 'idle' | 'running';
3
4
  setStatus: (status: 'loading' | 'idle' | 'running') => void;
5
+ renderedElement: React.ReactElement | null;
6
+ setRenderedElement: (element: React.ReactElement | null) => void;
7
+ updateRenderedElement: (element: React.ReactElement) => void;
8
+ renderKey: string | null;
9
+ onLayoutCallback: (() => void) | null;
10
+ setOnLayoutCallback: (callback: (() => void) | null) => void;
11
+ onRenderCallback: (() => void) | null;
12
+ setOnRenderCallback: (callback: (() => void) | null) => void;
4
13
  };
5
14
  export declare const store: import("zustand/react").UseBoundStore<import("zustand/vanilla").StoreApi<RunnerState>>;
6
15
  export declare const useRunnerStatus: () => "idle" | "loading" | "running";
16
+ export declare const useRenderedElement: () => {
17
+ element: React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null;
18
+ key: string | null;
19
+ };
7
20
  //# sourceMappingURL=state.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../src/ui/state.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;IACvC,SAAS,EAAE,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;CAC7D,CAAC;AAEF,eAAO,MAAM,KAAK,wFAGf,CAAC;AAEJ,eAAO,MAAM,eAAe,sCAAiD,CAAC"}
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../src/ui/state.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;IACvC,SAAS,EAAE,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC5D,eAAe,EAAE,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;IAC3C,kBAAkB,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,YAAY,GAAG,IAAI,KAAK,IAAI,CAAC;IACjE,qBAAqB,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,YAAY,KAAK,IAAI,CAAC;IAC7D,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,gBAAgB,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;IACtC,mBAAmB,EAAE,CAAC,QAAQ,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7D,gBAAgB,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;IACtC,mBAAmB,EAAE,CAAC,QAAQ,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;CAC9D,CAAC;AAEF,eAAO,MAAM,KAAK,wFAkBf,CAAC;AAEJ,eAAO,MAAM,eAAe,sCAAiD,CAAC;AAC9E,eAAO,MAAM,kBAAkB;;;CAQ5B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { ElementReference } from '@react-native-harness/bridge';
2
+ export type UserEvent = {
3
+ tap: (element: ElementReference) => Promise<void>;
4
+ };
5
+ export declare const userEvent: UserEvent;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/userEvent/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGrE,MAAM,MAAM,SAAS,GAAG;IACtB,GAAG,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD,CAAC;AAiBF,eAAO,MAAM,SAAS,WAAoB,CAAC"}