Skip to content

Commit e446c42

Browse files
committed
refactor: test mock helpers
Signed-off-by: Adam Setch <[email protected]>
1 parent 05c390b commit e446c42

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/renderer/__helpers__/test-utils.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,9 @@ export function renderWithAppContext(
5757
ui: ReactElement,
5858
context: Partial<AppContextState> = {},
5959
) {
60-
const value: Partial<AppContextState> = { ...context };
61-
6260
return render(ui, {
6361
wrapper: ({ children }) => (
64-
<AppContextProvider value={value}>{children}</AppContextProvider>
62+
<AppContextProvider value={context}>{children}</AppContextProvider>
6563
),
6664
});
6765
}
@@ -70,5 +68,5 @@ export function renderWithAppContext(
7068
* Ensure stable snapshots for our randomized emoji use-cases
7169
*/
7270
export function ensureStableEmojis() {
73-
global.Math.random = jest.fn(() => 0.1);
71+
globalThis.Math.random = jest.fn(() => 0.1);
7472
}

0 commit comments

Comments
 (0)