@trackunit/react-core-contexts-test 0.1.244 → 0.1.247

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.
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index.cjs2.js');
4
3
  var react = require('@testing-library/react');
5
4
  var pure = require('@testing-library/react/pure');
5
+ var index = require('./index.cjs.js');
6
6
  require('react/jsx-runtime');
7
7
  require('@trackunit/react-core-hooks');
8
8
  require('lodash/omit');
@@ -24,7 +24,7 @@ require('graphql');
24
24
  * @param getMockedCompositionRoot A function that will return the mocked composition root.
25
25
  * @returns { Promise<RenderHookResult> } The rendered hook.
26
26
  */
27
- const reactHooksRenderHook = (callback, getMockedCompositionRoot) => index.__awaiter(void 0, void 0, void 0, function* () {
27
+ const reactHooksRenderHook = async (callback, getMockedCompositionRoot) => {
28
28
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
29
  const wrapper = ({ children }) => {
30
30
  // eslint-disable-next-line react/jsx-no-useless-fragment
@@ -33,13 +33,13 @@ const reactHooksRenderHook = (callback, getMockedCompositionRoot) => index.__awa
33
33
  let renderedHook;
34
34
  // This is added here to make storybook work and to ensure the right act is loaded for hooks.
35
35
  // eslint-disable-next-line @typescript-eslint/no-var-requires
36
- yield react.act(() => index.__awaiter(void 0, void 0, void 0, function* () {
37
- renderedHook = yield pure.renderHook(callback, { wrapper });
38
- }));
39
- yield react.act(() => index.__awaiter(void 0, void 0, void 0, function* () {
40
- yield index.flushPromises();
41
- }));
36
+ await react.act(async () => {
37
+ renderedHook = await pure.renderHook(callback, { wrapper });
38
+ });
39
+ await react.act(async () => {
40
+ await index.flushPromises();
41
+ });
42
42
  return renderedHook;
43
- });
43
+ };
44
44
 
45
45
  exports.reactHooksRenderHook = reactHooksRenderHook;
@@ -1,6 +1,6 @@
1
- import { _ as __awaiter, f as flushPromises } from './index.esm2.js';
2
1
  import { act } from '@testing-library/react';
3
2
  import { renderHook } from '@testing-library/react/pure';
3
+ import { flushPromises } from './index.esm.js';
4
4
  import 'react/jsx-runtime';
5
5
  import '@trackunit/react-core-hooks';
6
6
  import 'lodash/omit';
@@ -22,7 +22,7 @@ import 'graphql';
22
22
  * @param getMockedCompositionRoot A function that will return the mocked composition root.
23
23
  * @returns { Promise<RenderHookResult> } The rendered hook.
24
24
  */
25
- const reactHooksRenderHook = (callback, getMockedCompositionRoot) => __awaiter(void 0, void 0, void 0, function* () {
25
+ const reactHooksRenderHook = async (callback, getMockedCompositionRoot) => {
26
26
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
27
  const wrapper = ({ children }) => {
28
28
  // eslint-disable-next-line react/jsx-no-useless-fragment
@@ -31,13 +31,13 @@ const reactHooksRenderHook = (callback, getMockedCompositionRoot) => __awaiter(v
31
31
  let renderedHook;
32
32
  // This is added here to make storybook work and to ensure the right act is loaded for hooks.
33
33
  // eslint-disable-next-line @typescript-eslint/no-var-requires
34
- yield act(() => __awaiter(void 0, void 0, void 0, function* () {
35
- renderedHook = yield renderHook(callback, { wrapper });
36
- }));
37
- yield act(() => __awaiter(void 0, void 0, void 0, function* () {
38
- yield flushPromises();
39
- }));
34
+ await act(async () => {
35
+ renderedHook = await renderHook(callback, { wrapper });
36
+ });
37
+ await act(async () => {
38
+ await flushPromises();
39
+ });
40
40
  return renderedHook;
41
- });
41
+ };
42
42
 
43
43
  export { reactHooksRenderHook };