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

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 (252) hide show
  1. package/README.md +23 -4
  2. package/assets/moduleSystem.flow.js +23 -3
  3. package/dist/bundler/bundle.d.ts.map +1 -1
  4. package/dist/bundler/bundle.js +1 -2
  5. package/dist/bundler/evaluate.d.ts.map +1 -1
  6. package/dist/bundler/evaluate.js +7 -7
  7. package/dist/bundler/factory.d.ts +3 -0
  8. package/dist/bundler/factory.d.ts.map +1 -0
  9. package/dist/bundler/factory.js +36 -0
  10. package/dist/bundler/index.d.ts +2 -1
  11. package/dist/bundler/index.d.ts.map +1 -1
  12. package/dist/bundler/index.js +1 -1
  13. package/dist/bundler/types.d.ts +7 -0
  14. package/dist/bundler/types.d.ts.map +1 -0
  15. package/dist/bundler/types.js +1 -0
  16. package/dist/client/factory.d.ts.map +1 -1
  17. package/dist/client/factory.js +33 -12
  18. package/dist/client/getDeviceDescriptor.d.ts +1 -1
  19. package/dist/client/getDeviceDescriptor.d.ts.map +1 -1
  20. package/dist/client/getDeviceDescriptor.js +18 -6
  21. package/dist/client/setup-files.d.ts +12 -0
  22. package/dist/client/setup-files.d.ts.map +1 -0
  23. package/dist/client/setup-files.js +60 -0
  24. package/dist/collector/functions.d.ts +1 -1
  25. package/dist/collector/functions.d.ts.map +1 -1
  26. package/dist/collector/functions.js +10 -2
  27. package/dist/collector/types.d.ts +1 -1
  28. package/dist/collector/types.d.ts.map +1 -1
  29. package/dist/constants.d.ts +0 -1
  30. package/dist/constants.d.ts.map +1 -1
  31. package/dist/constants.js +0 -1
  32. package/dist/entry-point.d.ts +2 -0
  33. package/dist/entry-point.d.ts.map +1 -0
  34. package/dist/entry-point.js +4 -0
  35. package/dist/expect/index.d.ts.map +1 -1
  36. package/dist/expect/index.js +2 -0
  37. package/dist/expect/setup.js +2 -0
  38. package/dist/filtering/index.d.ts +2 -0
  39. package/dist/filtering/index.d.ts.map +1 -0
  40. package/dist/filtering/index.js +1 -0
  41. package/dist/filtering/testNameFilter.d.ts +12 -0
  42. package/dist/filtering/testNameFilter.d.ts.map +1 -0
  43. package/dist/filtering/testNameFilter.js +56 -0
  44. package/dist/globals.d.ts +5 -2
  45. package/dist/globals.d.ts.map +1 -1
  46. package/dist/globals.js +7 -1
  47. package/dist/index.d.ts +3 -0
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +3 -0
  50. package/dist/initialize.js +7 -0
  51. package/dist/jest-mock.d.ts +2 -0
  52. package/dist/jest-mock.d.ts.map +1 -0
  53. package/dist/jest-mock.js +25 -0
  54. package/dist/mocker/index.d.ts +1 -1
  55. package/dist/mocker/index.d.ts.map +1 -1
  56. package/dist/mocker/index.js +1 -1
  57. package/dist/mocker/registry.d.ts +2 -2
  58. package/dist/mocker/registry.d.ts.map +1 -1
  59. package/dist/mocker/registry.js +10 -4
  60. package/dist/namespace.d.ts +18 -0
  61. package/dist/namespace.d.ts.map +1 -0
  62. package/dist/namespace.js +19 -0
  63. package/dist/render/ErrorBoundary.d.ts +17 -0
  64. package/dist/render/ErrorBoundary.d.ts.map +1 -0
  65. package/dist/render/ErrorBoundary.js +73 -0
  66. package/dist/render/TestComponentOverlay.d.ts +3 -0
  67. package/dist/render/TestComponentOverlay.d.ts.map +1 -0
  68. package/dist/render/TestComponentOverlay.js +36 -0
  69. package/dist/render/cleanup.d.ts +2 -0
  70. package/dist/render/cleanup.d.ts.map +1 -0
  71. package/dist/render/cleanup.js +6 -0
  72. package/dist/render/index.d.ts +6 -0
  73. package/dist/render/index.d.ts.map +1 -0
  74. package/dist/render/index.js +66 -0
  75. package/dist/render/setup.d.ts +2 -0
  76. package/dist/render/setup.d.ts.map +1 -0
  77. package/dist/render/setup.js +7 -0
  78. package/dist/render/types.d.ts +12 -0
  79. package/dist/render/types.d.ts.map +1 -0
  80. package/dist/render/types.js +1 -0
  81. package/dist/runner/factory.d.ts.map +1 -1
  82. package/dist/runner/factory.js +6 -1
  83. package/dist/runner/runSuite.d.ts.map +1 -1
  84. package/dist/runner/runSuite.js +37 -0
  85. package/dist/symbolicate.d.ts.map +1 -1
  86. package/dist/symbolicate.js +5 -4
  87. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  88. package/dist/ui/ReadyScreen.d.ts.map +1 -1
  89. package/dist/ui/ReadyScreen.js +3 -10
  90. package/dist/ui/WrongEnvironmentScreen.d.ts.map +1 -1
  91. package/dist/ui/WrongEnvironmentScreen.js +2 -10
  92. package/dist/ui/state.d.ts +13 -0
  93. package/dist/ui/state.d.ts.map +1 -1
  94. package/dist/ui/state.js +22 -0
  95. package/dist/utils/emitter.d.ts.map +1 -1
  96. package/dist/waitFor.d.ts +21 -0
  97. package/dist/waitFor.d.ts.map +1 -0
  98. package/dist/waitFor.js +137 -0
  99. package/eslint.config.mjs +1 -7
  100. package/out-tsc/vitest/src/__tests__/collector.test.d.ts +2 -0
  101. package/out-tsc/vitest/src/__tests__/collector.test.d.ts.map +1 -0
  102. package/out-tsc/vitest/src/__tests__/error-handling.test.d.ts +2 -0
  103. package/out-tsc/vitest/src/__tests__/error-handling.test.d.ts.map +1 -0
  104. package/out-tsc/vitest/src/__tests__/expect.test.d.ts +2 -0
  105. package/out-tsc/vitest/src/__tests__/expect.test.d.ts.map +1 -0
  106. package/out-tsc/vitest/src/__tests__/spy.test.d.ts +2 -0
  107. package/out-tsc/vitest/src/__tests__/spy.test.d.ts.map +1 -0
  108. package/out-tsc/vitest/src/bundler/bundle.d.ts +2 -0
  109. package/out-tsc/vitest/src/bundler/bundle.d.ts.map +1 -0
  110. package/out-tsc/vitest/src/bundler/errors.d.ts +15 -0
  111. package/out-tsc/vitest/src/bundler/errors.d.ts.map +1 -0
  112. package/out-tsc/vitest/src/bundler/evaluate.d.ts +2 -0
  113. package/out-tsc/vitest/src/bundler/evaluate.d.ts.map +1 -0
  114. package/out-tsc/vitest/src/bundler/factory.d.ts +3 -0
  115. package/out-tsc/vitest/src/bundler/factory.d.ts.map +1 -0
  116. package/out-tsc/vitest/src/bundler/index.d.ts +4 -0
  117. package/out-tsc/vitest/src/bundler/index.d.ts.map +1 -0
  118. package/out-tsc/vitest/src/bundler/types.d.ts +7 -0
  119. package/out-tsc/vitest/src/bundler/types.d.ts.map +1 -0
  120. package/out-tsc/vitest/src/client/factory.d.ts +2 -0
  121. package/out-tsc/vitest/src/client/factory.d.ts.map +1 -0
  122. package/out-tsc/vitest/src/client/getDeviceDescriptor.d.ts +8 -0
  123. package/out-tsc/vitest/src/client/getDeviceDescriptor.d.ts.map +1 -0
  124. package/out-tsc/vitest/src/client/getWSServer.d.ts +2 -0
  125. package/out-tsc/vitest/src/client/getWSServer.d.ts.map +1 -0
  126. package/out-tsc/vitest/src/client/index.d.ts +2 -0
  127. package/out-tsc/vitest/src/client/index.d.ts.map +1 -0
  128. package/out-tsc/vitest/src/collector/errors.d.ts +8 -0
  129. package/out-tsc/vitest/src/collector/errors.d.ts.map +1 -0
  130. package/out-tsc/vitest/src/collector/factory.d.ts +3 -0
  131. package/out-tsc/vitest/src/collector/factory.d.ts.map +1 -0
  132. package/out-tsc/vitest/src/collector/functions.d.ts +22 -0
  133. package/out-tsc/vitest/src/collector/functions.d.ts.map +1 -0
  134. package/out-tsc/vitest/src/collector/index.d.ts +5 -0
  135. package/out-tsc/vitest/src/collector/index.d.ts.map +1 -0
  136. package/out-tsc/vitest/src/collector/types.d.ts +10 -0
  137. package/out-tsc/vitest/src/collector/types.d.ts.map +1 -0
  138. package/out-tsc/vitest/src/collector/validation.d.ts +4 -0
  139. package/out-tsc/vitest/src/collector/validation.d.ts.map +1 -0
  140. package/out-tsc/vitest/src/constants.d.ts +3 -0
  141. package/out-tsc/vitest/src/constants.d.ts.map +1 -0
  142. package/out-tsc/vitest/src/entry-point.d.ts +2 -0
  143. package/out-tsc/vitest/src/entry-point.d.ts.map +1 -0
  144. package/out-tsc/vitest/src/errors.d.ts +6 -0
  145. package/out-tsc/vitest/src/errors.d.ts.map +1 -0
  146. package/out-tsc/vitest/src/expect/index.d.ts +9 -0
  147. package/out-tsc/vitest/src/expect/index.d.ts.map +1 -0
  148. package/out-tsc/vitest/src/expect/setup.d.ts +2 -0
  149. package/out-tsc/vitest/src/expect/setup.d.ts.map +1 -0
  150. package/out-tsc/vitest/src/filtering/index.d.ts +2 -0
  151. package/out-tsc/vitest/src/filtering/index.d.ts.map +1 -0
  152. package/out-tsc/vitest/src/filtering/testNameFilter.d.ts +12 -0
  153. package/out-tsc/vitest/src/filtering/testNameFilter.d.ts.map +1 -0
  154. package/out-tsc/vitest/src/globals.d.ts +8 -0
  155. package/out-tsc/vitest/src/globals.d.ts.map +1 -0
  156. package/out-tsc/vitest/src/index.d.ts +9 -0
  157. package/out-tsc/vitest/src/index.d.ts.map +1 -0
  158. package/out-tsc/vitest/src/initialize.d.ts +2 -0
  159. package/out-tsc/vitest/src/initialize.d.ts.map +1 -0
  160. package/out-tsc/vitest/src/mocker/index.d.ts +2 -0
  161. package/out-tsc/vitest/src/mocker/index.d.ts.map +1 -0
  162. package/out-tsc/vitest/src/mocker/registry.d.ts +7 -0
  163. package/out-tsc/vitest/src/mocker/registry.d.ts.map +1 -0
  164. package/out-tsc/vitest/src/mocker/types.d.ts +6 -0
  165. package/out-tsc/vitest/src/mocker/types.d.ts.map +1 -0
  166. package/out-tsc/vitest/src/namespace.d.ts +18 -0
  167. package/out-tsc/vitest/src/namespace.d.ts.map +1 -0
  168. package/out-tsc/vitest/src/runner/errors.d.ts +11 -0
  169. package/out-tsc/vitest/src/runner/errors.d.ts.map +1 -0
  170. package/out-tsc/vitest/src/runner/factory.d.ts +3 -0
  171. package/out-tsc/vitest/src/runner/factory.d.ts.map +1 -0
  172. package/out-tsc/vitest/src/runner/hooks.d.ts +4 -0
  173. package/out-tsc/vitest/src/runner/hooks.d.ts.map +1 -0
  174. package/out-tsc/vitest/src/runner/index.d.ts +4 -0
  175. package/out-tsc/vitest/src/runner/index.d.ts.map +1 -0
  176. package/out-tsc/vitest/src/runner/runSuite.d.ts +4 -0
  177. package/out-tsc/vitest/src/runner/runSuite.d.ts.map +1 -0
  178. package/out-tsc/vitest/src/runner/types.d.ts +13 -0
  179. package/out-tsc/vitest/src/runner/types.d.ts.map +1 -0
  180. package/out-tsc/vitest/src/spy/index.d.ts +2 -0
  181. package/out-tsc/vitest/src/spy/index.d.ts.map +1 -0
  182. package/out-tsc/vitest/src/symbolicate.d.ts +3 -0
  183. package/out-tsc/vitest/src/symbolicate.d.ts.map +1 -0
  184. package/out-tsc/vitest/src/ui/ReadyScreen.d.ts +2 -0
  185. package/out-tsc/vitest/src/ui/ReadyScreen.d.ts.map +1 -0
  186. package/out-tsc/vitest/src/ui/WrongEnvironmentScreen.d.ts +2 -0
  187. package/out-tsc/vitest/src/ui/WrongEnvironmentScreen.d.ts.map +1 -0
  188. package/out-tsc/vitest/src/ui/index.d.ts +2 -0
  189. package/out-tsc/vitest/src/ui/index.d.ts.map +1 -0
  190. package/out-tsc/vitest/src/ui/state.d.ts +7 -0
  191. package/out-tsc/vitest/src/ui/state.d.ts.map +1 -0
  192. package/out-tsc/vitest/src/utils/dev-server.d.ts +2 -0
  193. package/out-tsc/vitest/src/utils/dev-server.d.ts.map +1 -0
  194. package/out-tsc/vitest/src/utils/emitter.d.ts +16 -0
  195. package/out-tsc/vitest/src/utils/emitter.d.ts.map +1 -0
  196. package/out-tsc/vitest/src/waitFor.d.ts +21 -0
  197. package/out-tsc/vitest/src/waitFor.d.ts.map +1 -0
  198. package/out-tsc/vitest/tsconfig.spec.tsbuildinfo +1 -0
  199. package/out-tsc/vitest/vite.config.d.ts +3 -0
  200. package/out-tsc/vitest/vite.config.d.ts.map +1 -0
  201. package/package.json +10 -4
  202. package/src/__tests__/collector.test.ts +55 -55
  203. package/src/__tests__/error-handling.test.ts +34 -34
  204. package/src/__tests__/expect.test.ts +13 -5
  205. package/src/bundler/bundle.ts +1 -2
  206. package/src/bundler/evaluate.ts +9 -9
  207. package/src/bundler/factory.ts +43 -0
  208. package/src/bundler/index.ts +2 -1
  209. package/src/bundler/types.ts +7 -0
  210. package/src/client/factory.ts +51 -16
  211. package/src/client/getDeviceDescriptor.ts +29 -8
  212. package/src/client/setup-files.ts +81 -0
  213. package/src/collector/functions.ts +18 -2
  214. package/src/collector/types.ts +4 -1
  215. package/src/constants.ts +0 -1
  216. package/src/entry-point.ts +8 -0
  217. package/src/expect/index.ts +8 -2
  218. package/src/expect/setup.ts +3 -0
  219. package/src/filtering/index.ts +4 -0
  220. package/src/filtering/testNameFilter.ts +82 -0
  221. package/src/globals.ts +14 -2
  222. package/src/index.ts +3 -0
  223. package/src/initialize.ts +11 -1
  224. package/src/jest-mock.ts +32 -0
  225. package/src/mocker/index.ts +7 -1
  226. package/src/mocker/metro-require.d.ts +2 -0
  227. package/src/mocker/registry.ts +13 -5
  228. package/src/namespace.ts +41 -0
  229. package/src/react-native.d.ts +2 -10
  230. package/src/render/ErrorBoundary.tsx +108 -0
  231. package/src/render/TestComponentOverlay.tsx +47 -0
  232. package/src/render/cleanup.ts +7 -0
  233. package/src/render/index.ts +96 -0
  234. package/src/render/setup.ts +8 -0
  235. package/src/render/types.ts +11 -0
  236. package/src/runner/factory.ts +8 -1
  237. package/src/runner/runSuite.ts +43 -0
  238. package/src/symbolicate.ts +6 -4
  239. package/src/ui/ReadyScreen.tsx +2 -12
  240. package/src/ui/WrongEnvironmentScreen.tsx +1 -19
  241. package/src/ui/state.ts +39 -0
  242. package/src/utils/emitter.ts +1 -0
  243. package/src/waitFor.ts +199 -0
  244. package/tsconfig.spec.json +7 -3
  245. package/tsconfig.tsbuildinfo +1 -1
  246. package/assets/logo.png +0 -0
  247. package/dist/utils/progressLogger.d.ts +0 -8
  248. package/dist/utils/progressLogger.d.ts.map +0 -1
  249. package/dist/utils/progressLogger.js +0 -73
  250. package/src/utils/progressLogger.ts +0 -91
  251. package/types/global.d.ts +0 -2
  252. package/types/index.d.ts +0 -1
package/dist/globals.js CHANGED
@@ -1 +1,7 @@
1
- export {};
1
+ export const getHarnessGlobal = () => {
2
+ const harnessGlobal = global.RN_HARNESS;
3
+ if (!harnessGlobal) {
4
+ throw new Error('RN_HARNESS global is not set');
5
+ }
6
+ return harnessGlobal;
7
+ };
package/dist/index.d.ts CHANGED
@@ -4,4 +4,7 @@ export * from './spy/index.js';
4
4
  export * from './expect/index.js';
5
5
  export * from './collector/index.js';
6
6
  export * from './mocker/index.js';
7
+ export * from './namespace.js';
8
+ export * from './waitFor.js';
9
+ export * from './render/index.js';
7
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAExB,OAAO,EAAE,EAAE,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACzD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAExB,OAAO,EAAE,EAAE,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACzD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -4,3 +4,6 @@ export * from './spy/index.js';
4
4
  export * from './expect/index.js';
5
5
  export * from './collector/index.js';
6
6
  export * from './mocker/index.js';
7
+ export * from './namespace.js';
8
+ export * from './waitFor.js';
9
+ export * from './render/index.js';
@@ -1,9 +1,12 @@
1
1
  import { getDeviceDescriptor } from './client/getDeviceDescriptor.js';
2
2
  import { getClient } from './client/index.js';
3
+ import { setupJestMock } from './jest-mock.js';
3
4
  // Polyfill for EventTarget
4
5
  const Shim = require('event-target-shim');
5
6
  globalThis.Event = Shim.Event;
6
7
  globalThis.EventTarget = Shim.EventTarget;
8
+ // Setup jest mock to warn users about using Jest APIs
9
+ setupJestMock();
7
10
  // Turn off LogBox
8
11
  const { LogBox } = require('react-native');
9
12
  LogBox.ignoreAllLogs(true);
@@ -16,3 +19,7 @@ setTimeout(() => {
16
19
  // Initialize the React Native Harness
17
20
  void getClient().then((client) => client.rpc.reportReady(getDeviceDescriptor()));
18
21
  });
22
+ // Re-throw fatal errors
23
+ ErrorUtils.setGlobalHandler((error) => {
24
+ throw error;
25
+ });
@@ -0,0 +1,2 @@
1
+ export declare const setupJestMock: () => void;
2
+ //# sourceMappingURL=jest-mock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jest-mock.d.ts","sourceRoot":"","sources":["../src/jest-mock.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,aAAa,QAAO,IA8BhC,CAAC"}
@@ -0,0 +1,25 @@
1
+ // Mock jest global to warn users about using Jest APIs in Harness tests
2
+ export const setupJestMock = () => {
3
+ function throwError() {
4
+ throw new Error(`Jest globals are not available in Harness tests. Import from 'react-native-harness' instead (e.g., import { harness } from 'react-native-harness'; harness.fn())`);
5
+ }
6
+ const jestMock = new Proxy({}, {
7
+ get() {
8
+ throwError();
9
+ },
10
+ set() {
11
+ throwError();
12
+ },
13
+ has() {
14
+ throwError();
15
+ },
16
+ ownKeys() {
17
+ throwError();
18
+ },
19
+ });
20
+ Object.defineProperty(globalThis, 'jest', {
21
+ value: jestMock,
22
+ writable: false,
23
+ configurable: false,
24
+ });
25
+ };
@@ -1,2 +1,2 @@
1
- export { mock, requireActual, clearMocks } from './registry.js';
1
+ export { mock, requireActual, clearMocks, unmock, resetModules, } from './registry.js';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mocker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mocker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,aAAa,EACb,UAAU,EACV,MAAM,EACN,YAAY,GACb,MAAM,eAAe,CAAC"}
@@ -1 +1 @@
1
- export { mock, requireActual, clearMocks } from './registry.js';
1
+ export { mock, requireActual, clearMocks, unmock, resetModules, } from './registry.js';
@@ -1,7 +1,7 @@
1
1
  import { ModuleFactory } from './types.js';
2
2
  export declare const mock: (moduleId: string, factory: ModuleFactory) => void;
3
3
  export declare const clearMocks: () => void;
4
- export declare const getMockRegistry: () => Map<number, ModuleFactory>;
5
- export declare const getMockImplementation: (moduleId: number) => unknown | null;
6
4
  export declare const requireActual: <T = any>(moduleId: string) => T;
5
+ export declare const unmock: (moduleId: string) => void;
6
+ export declare const resetModules: () => void;
7
7
  //# sourceMappingURL=registry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/mocker/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAqB,MAAM,YAAY,CAAC;AAO9D,eAAO,MAAM,IAAI,GAAI,UAAU,MAAM,EAAE,SAAS,aAAa,KAAG,IAG/D,CAAC;AAEF,eAAO,MAAM,UAAU,QAAO,IAG7B,CAAC;AAEF,eAAO,MAAM,eAAe,QAAO,GAAG,CAAC,MAAM,EAAE,aAAa,CAE3D,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,UAAU,MAAM,KAAG,OAAO,GAAG,IAalE,CAAC;AAGF,eAAO,MAAM,aAAa,GAAI,CAAC,GAAG,GAAG,EAAE,UAAU,MAAM,KAAG,CAEH,CAAC"}
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/mocker/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAqB,MAAM,YAAY,CAAC;AAO9D,eAAO,MAAM,IAAI,GAAI,UAAU,MAAM,EAAE,SAAS,aAAa,KAAG,IAG/D,CAAC;AAEF,eAAO,MAAM,UAAU,QAAO,IAG7B,CAAC;AAkBF,eAAO,MAAM,aAAa,GAAI,CAAC,GAAG,GAAG,EAAE,UAAU,MAAM,KAAG,CAEH,CAAC;AAExD,eAAO,MAAM,MAAM,GAAI,UAAU,MAAM,SAGtC,CAAC;AAEF,eAAO,MAAM,YAAY,QAAO,IAK/B,CAAC"}
@@ -9,10 +9,7 @@ export const clearMocks = () => {
9
9
  mockRegistry.clear();
10
10
  mockCache.clear();
11
11
  };
12
- export const getMockRegistry = () => {
13
- return mockRegistry;
14
- };
15
- export const getMockImplementation = (moduleId) => {
12
+ const getMockImplementation = (moduleId) => {
16
13
  if (mockCache.has(moduleId)) {
17
14
  return mockCache.get(moduleId);
18
15
  }
@@ -28,6 +25,15 @@ export const getMockImplementation = (moduleId) => {
28
25
  export const requireActual = (moduleId) =>
29
26
  // babel plugin will transform 'moduleId' to a number
30
27
  originalRequire(moduleId);
28
+ export const unmock = (moduleId) => {
29
+ mockRegistry.delete(moduleId);
30
+ mockCache.delete(moduleId);
31
+ };
32
+ export const resetModules = () => {
33
+ mockCache.clear();
34
+ // Reset Metro's module cache
35
+ global.__resetAllModules();
36
+ };
31
37
  const mockRequire = (moduleId) => {
32
38
  // babel plugin will transform 'moduleId' to a number
33
39
  const mockedModule = getMockImplementation(moduleId);
@@ -0,0 +1,18 @@
1
+ import { spyOn, fn, clearAllMocks, resetAllMocks, restoreAllMocks } from './spy/index.js';
2
+ import { mock, unmock, requireActual, resetModules } from './mocker/index.js';
3
+ import { waitFor, waitUntil } from './waitFor.js';
4
+ export type HarnessNamespace = {
5
+ spyOn: typeof spyOn;
6
+ fn: typeof fn;
7
+ mock: typeof mock;
8
+ unmock: typeof unmock;
9
+ requireActual: typeof requireActual;
10
+ clearAllMocks: typeof clearAllMocks;
11
+ resetAllMocks: typeof resetAllMocks;
12
+ restoreAllMocks: typeof restoreAllMocks;
13
+ resetModules: typeof resetModules;
14
+ waitFor: typeof waitFor;
15
+ waitUntil: typeof waitUntil;
16
+ };
17
+ export declare const harness: HarnessNamespace;
18
+ //# sourceMappingURL=namespace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"namespace.d.ts","sourceRoot":"","sources":["../src/namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,EAAE,EACF,aAAa,EACb,aAAa,EACb,eAAe,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,EAAE,EAAE,OAAO,EAAE,CAAC;IACd,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,MAAM,EAAE,OAAO,MAAM,CAAC;IACtB,aAAa,EAAE,OAAO,aAAa,CAAC;IACpC,aAAa,EAAE,OAAO,aAAa,CAAC;IACpC,aAAa,EAAE,OAAO,aAAa,CAAC;IACpC,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,YAAY,EAAE,OAAO,YAAY,CAAC;IAClC,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,SAAS,EAAE,OAAO,SAAS,CAAC;CAC7B,CAAC;AAkBF,eAAO,MAAM,OAAO,kBAA2B,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { spyOn, fn, clearAllMocks, resetAllMocks, restoreAllMocks, } from './spy/index.js';
2
+ import { mock, unmock, requireActual, resetModules } from './mocker/index.js';
3
+ import { waitFor, waitUntil } from './waitFor.js';
4
+ const createHarnessNamespace = () => {
5
+ return {
6
+ spyOn,
7
+ fn,
8
+ mock,
9
+ unmock,
10
+ requireActual,
11
+ clearAllMocks,
12
+ resetAllMocks,
13
+ restoreAllMocks,
14
+ resetModules,
15
+ waitFor,
16
+ waitUntil,
17
+ };
18
+ };
19
+ export const harness = createHarnessNamespace();
@@ -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,73 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { View, Text, StyleSheet, ScrollView } from 'react-native';
4
+ export class ErrorBoundary extends React.Component {
5
+ constructor(props) {
6
+ super(props);
7
+ this.state = { hasError: false, error: null };
8
+ }
9
+ static getDerivedStateFromError(error) {
10
+ return { hasError: true, error };
11
+ }
12
+ componentDidCatch(error, errorInfo) {
13
+ console.error('Error caught by ErrorBoundary:', error, errorInfo);
14
+ }
15
+ componentDidUpdate(prevProps) {
16
+ // Reset error state when children change (new component rendered)
17
+ if (prevProps.children !== this.props.children && this.state.hasError) {
18
+ this.setState({ hasError: false, error: null });
19
+ }
20
+ }
21
+ render() {
22
+ if (this.state.hasError && this.state.error) {
23
+ return (_jsx(View, { style: styles.errorContainer, children: _jsxs(View, { style: styles.errorContent, children: [_jsx(Text, { style: styles.errorTitle, children: "Component Error" }), _jsx(Text, { style: styles.errorSubtitle, children: "The rendered component threw an error:" }), _jsxs(ScrollView, { style: styles.errorScrollView, children: [_jsx(Text, { style: styles.errorMessage, children: this.state.error.message }), this.state.error.stack && (_jsx(Text, { style: styles.errorStack, children: this.state.error.stack }))] })] }) }));
24
+ }
25
+ return this.props.children;
26
+ }
27
+ }
28
+ const styles = StyleSheet.create({
29
+ errorContainer: {
30
+ flex: 1,
31
+ backgroundColor: 'rgba(220, 38, 38, 0.1)',
32
+ justifyContent: 'center',
33
+ alignItems: 'center',
34
+ padding: 20,
35
+ },
36
+ errorContent: {
37
+ backgroundColor: '#1f2937',
38
+ borderRadius: 12,
39
+ padding: 20,
40
+ maxWidth: 500,
41
+ width: '100%',
42
+ maxHeight: '80%',
43
+ borderWidth: 2,
44
+ borderColor: '#dc2626',
45
+ },
46
+ errorTitle: {
47
+ fontSize: 24,
48
+ fontWeight: '700',
49
+ color: '#dc2626',
50
+ marginBottom: 8,
51
+ },
52
+ errorSubtitle: {
53
+ fontSize: 14,
54
+ color: '#9ca3af',
55
+ marginBottom: 16,
56
+ },
57
+ errorScrollView: {
58
+ maxHeight: 400,
59
+ },
60
+ errorMessage: {
61
+ fontSize: 16,
62
+ fontWeight: '600',
63
+ color: '#fca5a5',
64
+ marginBottom: 12,
65
+ fontFamily: 'Courier',
66
+ },
67
+ errorStack: {
68
+ fontSize: 12,
69
+ color: '#d1d5db',
70
+ fontFamily: 'Courier',
71
+ lineHeight: 18,
72
+ },
73
+ });
@@ -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,36 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect } from 'react';
3
+ import { View, StyleSheet } from 'react-native';
4
+ import { useRenderedElement } from '../ui/state.js';
5
+ import { store } from '../ui/state.js';
6
+ import { ErrorBoundary } from './ErrorBoundary.js';
7
+ export const TestComponentOverlay = () => {
8
+ const { element, key } = useRenderedElement();
9
+ useEffect(() => {
10
+ // Call onRenderCallback when element changes
11
+ const callback = store.getState().onRenderCallback;
12
+ if (callback) {
13
+ callback();
14
+ store.getState().setOnRenderCallback(null);
15
+ }
16
+ }, [element]);
17
+ if (!element) {
18
+ return null;
19
+ }
20
+ const handleLayout = () => {
21
+ const callback = store.getState().onLayoutCallback;
22
+ if (callback) {
23
+ callback();
24
+ // Clear the callback after calling it
25
+ store.getState().setOnLayoutCallback(null);
26
+ }
27
+ };
28
+ return (_jsx(View, { style: styles.overlay, onLayout: handleLayout, children: _jsx(ErrorBoundary, { children: element }) }, key));
29
+ };
30
+ const styles = StyleSheet.create({
31
+ overlay: {
32
+ ...StyleSheet.absoluteFillObject,
33
+ backgroundColor: '#0a1628',
34
+ zIndex: 1000,
35
+ },
36
+ });
@@ -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 { store } from '../ui/state.js';
2
+ export const cleanup = () => {
3
+ store.getState().setRenderedElement(null);
4
+ store.getState().setOnLayoutCallback(null);
5
+ store.getState().setOnRenderCallback(null);
6
+ };
@@ -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,66 @@
1
+ import React from 'react';
2
+ import { store } from '../ui/state.js';
3
+ const wrapElement = (element, wrapper) => {
4
+ if (!wrapper) {
5
+ return element;
6
+ }
7
+ return React.createElement(wrapper, { children: element });
8
+ };
9
+ export const render = async (element, options = {}) => {
10
+ const { timeout = 1000, wrapper } = options;
11
+ // If an element is already rendered, unmount it first
12
+ if (store.getState().renderedElement !== null) {
13
+ store.getState().setRenderedElement(null);
14
+ store.getState().setOnLayoutCallback(null);
15
+ store.getState().setOnRenderCallback(null);
16
+ }
17
+ // Create a promise that resolves when the element is laid out
18
+ const layoutPromise = new Promise((resolve, reject) => {
19
+ const timeoutId = setTimeout(() => {
20
+ store.getState().setOnLayoutCallback(null);
21
+ reject(new Error(`Render timeout: Element did not mount within ${timeout}ms`));
22
+ }, timeout);
23
+ store.getState().setOnLayoutCallback(() => {
24
+ clearTimeout(timeoutId);
25
+ resolve();
26
+ });
27
+ });
28
+ // Wrap and set the element in state (key is generated automatically)
29
+ const wrappedElement = wrapElement(element, wrapper);
30
+ store.getState().setRenderedElement(wrappedElement);
31
+ // Wait for layout
32
+ await layoutPromise;
33
+ const rerender = async (newElement) => {
34
+ if (store.getState().renderedElement === null) {
35
+ throw new Error('No element is currently rendered. Call render() first.');
36
+ }
37
+ // Create a promise that resolves when the element is re-rendered
38
+ const renderPromise = new Promise((resolve, reject) => {
39
+ const timeoutId = setTimeout(() => {
40
+ store.getState().setOnRenderCallback(null);
41
+ reject(new Error(`Rerender timeout: Element did not update within ${timeout}ms`));
42
+ }, timeout);
43
+ store.getState().setOnRenderCallback(() => {
44
+ clearTimeout(timeoutId);
45
+ resolve();
46
+ });
47
+ });
48
+ const wrappedNewElement = wrapElement(newElement, wrapper);
49
+ store.getState().updateRenderedElement(wrappedNewElement);
50
+ // Wait for render
51
+ await renderPromise;
52
+ };
53
+ const unmount = () => {
54
+ if (store.getState().renderedElement === null) {
55
+ return;
56
+ }
57
+ store.getState().setRenderedElement(null);
58
+ store.getState().setOnLayoutCallback(null);
59
+ store.getState().setOnRenderCallback(null);
60
+ };
61
+ return {
62
+ rerender,
63
+ unmount,
64
+ };
65
+ };
66
+ export { cleanup } from './cleanup.js';
@@ -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,7 @@
1
+ import { afterEach } from '../collector/functions.js';
2
+ import { cleanup } from './cleanup.js';
3
+ export const setup = () => {
4
+ afterEach(() => {
5
+ cleanup();
6
+ });
7
+ };
@@ -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"}
@@ -0,0 +1 @@
1
+ export {};
@@ -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"}
@@ -5,10 +5,15 @@ export const getTestRunner = () => {
5
5
  return {
6
6
  events,
7
7
  run: async (testSuite, testFilePath) => {
8
- return runSuite(testSuite, {
8
+ const result = await runSuite(testSuite, {
9
9
  events,
10
10
  testFilePath,
11
11
  });
12
+ // If coverage is enabled, there will be a global variable called __coverage__
13
+ if ('__coverage__' in global && !!global.__coverage__) {
14
+ result.coverage = global.__coverage__;
15
+ }
16
+ return result;
12
17
  },
13
18
  dispose: () => {
14
19
  events.clearAllListeners();
@@ -1 +1 @@
1
- {"version":3,"file":"runSuite.d.ts","sourceRoot":"","sources":["../../src/runner/runSuite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,SAAS,EACT,eAAe,EAChB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAsH/C,eAAO,MAAM,QAAQ,GACnB,OAAO,SAAS,EAChB,SAAS,iBAAiB,KACzB,OAAO,CAAC,eAAe,CAyFzB,CAAC"}
1
+ {"version":3,"file":"runSuite.d.ts","sourceRoot":"","sources":["../../src/runner/runSuite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,SAAS,EACT,eAAe,EAChB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAsH/C,eAAO,MAAM,QAAQ,GACnB,OAAO,SAAS,EAChB,SAAS,iBAAiB,KACzB,OAAO,CAAC,eAAe,CAoIzB,CAAC"}
@@ -98,6 +98,43 @@ export const runSuite = async (suite, context) => {
98
98
  name: suite.name,
99
99
  file: context.testFilePath,
100
100
  });
101
+ // Check if suite should be skipped or is todo
102
+ if (suite.status === 'skipped') {
103
+ const result = {
104
+ name: suite.name,
105
+ tests: [],
106
+ suites: [],
107
+ status: 'skipped',
108
+ duration: 0,
109
+ };
110
+ // Emit suite-finished event
111
+ context.events.emit({
112
+ type: 'suite-finished',
113
+ file: context.testFilePath,
114
+ name: suite.name,
115
+ duration: 0,
116
+ status: 'skipped',
117
+ });
118
+ return result;
119
+ }
120
+ if (suite.status === 'todo') {
121
+ const result = {
122
+ name: suite.name,
123
+ tests: [],
124
+ suites: [],
125
+ status: 'todo',
126
+ duration: 0,
127
+ };
128
+ // Emit suite-finished event
129
+ context.events.emit({
130
+ type: 'suite-finished',
131
+ file: context.testFilePath,
132
+ name: suite.name,
133
+ duration: 0,
134
+ status: 'todo',
135
+ });
136
+ return result;
137
+ }
101
138
  const testResults = [];
102
139
  const suiteResults = [];
103
140
  // Run beforeAll hooks
@@ -1 +1 @@
1
- {"version":3,"file":"symbolicate.d.ts","sourceRoot":"","sources":["../src/symbolicate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAI9D,eAAO,MAAM,YAAY,GAAU,OAAO,KAAK,KAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAiBzE,CAAC"}
1
+ {"version":3,"file":"symbolicate.d.ts","sourceRoot":"","sources":["../src/symbolicate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAI9D,eAAO,MAAM,YAAY,GAAU,OAAO,KAAK,KAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAmBzE,CAAC"}
@@ -3,15 +3,16 @@ import symbolicateStackTrace from 'react-native/Libraries/Core/Devtools/symbolic
3
3
  export const getCodeFrame = async (error) => {
4
4
  const parsedStack = parseErrorStack(error.stack);
5
5
  const symbolicatedStack = await symbolicateStackTrace(parsedStack);
6
- if (!symbolicatedStack.codeFrame) {
6
+ if (!('codeFrame' in symbolicatedStack) || !symbolicatedStack.codeFrame) {
7
7
  return null;
8
8
  }
9
+ const codeFrame = symbolicatedStack.codeFrame;
9
10
  // Normalize optionality (null -> undefined)
10
11
  return {
11
- ...symbolicatedStack.codeFrame,
12
- location: symbolicatedStack.codeFrame.location
12
+ ...codeFrame,
13
+ location: codeFrame.location
13
14
  ? {
14
- ...symbolicatedStack.codeFrame.location,
15
+ ...codeFrame.location,
15
16
  }
16
17
  : undefined,
17
18
  };