From d43033cfcdeb3509b29475f5c3c504d274aa8c5f Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Mon, 9 May 2022 13:04:52 +0200 Subject: [PATCH] add mock --- __tests__/finder.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/__tests__/finder.test.ts b/__tests__/finder.test.ts index 4faa777a..7e9eaa47 100644 --- a/__tests__/finder.test.ts +++ b/__tests__/finder.test.ts @@ -127,6 +127,9 @@ describe('Finder tests', () => { fs.writeFileSync(`${expPath}.complete`, 'hello'); }); + const tcFindSpy: jest.SpyInstance = jest.spyOn(tc, 'find'); + tcFindSpy.mockImplementationOnce(() => "").mockImplementationOnce(() => expPath); + await io.mkdirP(pythonDir); await io.rmRF(path.join(toolDir, 'Python', '1.2.3'));