( mock: MockInitCmdFlagsExpectation, debug = false )
| 185 | } |
| 186 | |
| 187 | export const initCommandArgvGetterMethodTester = async ( |
| 188 | mock: MockInitCmdFlagsExpectation, |
| 189 | debug = false |
| 190 | ): Promise<void> => { |
| 191 | debug && logger.debug('******') |
| 192 | debug && logger.debug(`Test ${mock.methodToTest}`) |
| 193 | debug && logger.debug(`argvList: ${JSON.stringify(mock.argvList)}`) |
| 194 | const Init = await getInitCommand(mock.argvList, 'aws') |
| 195 | const response = await Init[mock.methodToTest](mock.overwriteFlag) |
| 196 | debug && logger.debug(`response: ${JSON.stringify(response)}`) |
| 197 | expect(response).toMatchObject(mock.expectedResult) |
| 198 | debug && |
| 199 | logger.debug(`expectedResult: ${JSON.stringify(mock.expectedResult)}`) |
| 200 | } |
| 201 | |
| 202 | export const removeConfigFile = (debug = false): void => { |
| 203 | const filePath = path.join(configDir, '.cloud-graphrc.json') |
no test coverage detected