From 715c56422059c95d343aefad5d7b2101f279c0d5 Mon Sep 17 00:00:00 2001 From: Tom Mrazauskas Date: Fri, 12 Aug 2022 09:29:07 +0300 Subject: [PATCH] use `jest.mocked()` in TS example --- examples/typescript/__tests__/calc.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/typescript/__tests__/calc.test.ts b/examples/typescript/__tests__/calc.test.ts index cb9bd0210549..7a05eadd8757 100644 --- a/examples/typescript/__tests__/calc.test.ts +++ b/examples/typescript/__tests__/calc.test.ts @@ -1,3 +1,7 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. + +import {jest} from '@jest/globals'; + import Memory from '../memory'; import sub from '../sub'; import sum from '../sum'; @@ -9,7 +13,7 @@ jest.mock('../sum'); const mockSub = jest.mocked(sub); const mockSum = jest.mocked(sum); -const MockMemory = Memory as jest.MockedClass; +const MockMemory = jest.mocked(Memory); describe('calc - mocks', () => { const memory = new MockMemory();