( argv: any = [''], providerName = '' )
| 55 | } |
| 56 | |
| 57 | export const getInitCommand = async ( |
| 58 | argv: any = [''], |
| 59 | providerName = '' |
| 60 | ): Promise<InitCommandClass> => { |
| 61 | const { version } = await setConfigCommand() |
| 62 | // Mock the provider module |
| 63 | InitCommandClass.prototype.getProviderClient = jest.fn(async function () { |
| 64 | return { client: Provider, schemaMap: {} } |
| 65 | }) |
| 66 | InitCommandClass.prototype.checkProviderConfig = jest.fn(async function () { |
| 67 | return configFileMock.aws as any |
| 68 | }) |
| 69 | InitCommandClass.prototype.getProvider = jest.fn(async function () { |
| 70 | return providerName |
| 71 | }) |
| 72 | InitCommandClass.prototype.providers = {} |
| 73 | InitCommandClass.prototype.providers.aws = jest.fn() |
| 74 | const initCommand = new InitCommandClass(argv, { root }) |
| 75 | initCommand.config.configDir = configDir |
| 76 | initCommand.config.dataDir = dataDir |
| 77 | initCommand.config.version = version |
| 78 | return initCommand |
| 79 | } |
| 80 | |
| 81 | export const getServeCommand = async ( |
| 82 | argv: any = [''] |
no test coverage detected