File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 1- jest . mock ( 'execa' ) ;
1+ jest . mock ( 'execa' , ( ) => ( {
2+ __esModule : true ,
3+ execa : jest . fn ( ) ,
4+ } ) ) ;
25
3- import { execa } from 'execa' ;
46import {
57 sanitizeRepoName ,
68 checkGhAuth ,
79 repoExists ,
810 createRepo ,
911} from '../github.js' ;
1012
11- const mockExeca = execa as jest . MockedFunction < typeof execa > ;
13+ const { execa : mockExeca } = require ( ' execa' ) ;
1214
1315describe ( 'sanitizeRepoName' , ( ) => {
1416 it ( 'returns lowercase name with invalid chars replaced by hyphen' , ( ) => {
@@ -93,7 +95,7 @@ describe('checkGhAuth', () => {
9395 stdout : ' octocat ' ,
9496 stderr : '' ,
9597 exitCode : 0 ,
96- } as Awaited < ReturnType < typeof execa > > ) ;
98+ } ) ;
9799
98100 const result = await checkGhAuth ( ) ;
99101
@@ -135,9 +137,7 @@ describe('createRepo', () => {
135137
136138 beforeEach ( ( ) => {
137139 mockExeca . mockReset ( ) ;
138- mockExeca . mockResolvedValue ( { stdout : '' , stderr : '' , exitCode : 0 } as Awaited <
139- ReturnType < typeof execa >
140- > ) ;
140+ mockExeca . mockResolvedValue ( { stdout : '' , stderr : '' , exitCode : 0 } ) ;
141141 } ) ;
142142
143143 it ( 'calls gh repo create with expected args and returns repo URL' , async ( ) => {
You can’t perform that action at this time.
0 commit comments