@@ -5,7 +5,6 @@ import * as fs from 'node:fs';
55import os from 'node:os' ;
66import path from 'node:path' ;
77import { DEFAULT_TS_MANIFEST } from '@subql/common' ;
8- import { simpleGit as git } from 'simple-git' ;
98import { ENDPOINT_REG } from '../constants.js' ;
109import { extractFromTs , findReplace , validateEthereumTsManifest } from '../utils/index.js' ;
1110import {
@@ -18,12 +17,12 @@ import {
1817 validateEthereumProjectManifest ,
1918} from './init-controller.js' ;
2019
21- jest . mock ( 'simple-git' , ( ) => {
22- const mGit = {
23- clone : jest . fn ( ) ,
24- } ;
25- return jest . fn ( ( ) => mGit ) ;
26- } ) ;
20+ // jest.mock('simple-git', () => {
21+ // const mGit = {
22+ // clone: jest.fn(),
23+ // };
24+ // return jest.fn(() => mGit);
25+ // });
2726
2827jest . setTimeout ( 30000 ) ;
2928
@@ -59,9 +58,6 @@ describe('Cli can create project (mocked)', () => {
5958 } ) ;
6059 it ( 'throw error when git clone failed' , async ( ) => {
6160 const tempPath = await makeTempDir ( ) ;
62- ( git ( ) . clone as jest . Mock ) . mockImplementationOnce ( ( cb ) => {
63- cb ( new Error ( ) ) ;
64- } ) ;
6561 await expect ( cloneProjectGit ( tempPath , projectSpec . name , 'invalid_url' , 'invalid_branch' ) ) . rejects . toThrow (
6662 / F a i l e d t o c l o n e s t a r t e r t e m p l a t e f r o m g i t /
6763 ) ;
0 commit comments