( flag: string, flagInput: string | number | undefined, debug = false )
| 127 | } |
| 128 | |
| 129 | export const flagTestHelper = async ( |
| 130 | flag: string, |
| 131 | flagInput: string | number | undefined, |
| 132 | debug = false |
| 133 | ): Promise<void> => { |
| 134 | debug && logger.debug('******') |
| 135 | debug && logger.debug(`Flag '--${flag}' Test(helper)`) |
| 136 | const flagInputConcatString = flagInput ? `=${flagInput}` : '' |
| 137 | const flagEntry = `--${flag}${flagInputConcatString}` |
| 138 | debug && logger.debug(`Full flag arg to test: '${flagEntry}'`) |
| 139 | const Init = await getInitCommand([flagEntry]) |
| 140 | const { flags } = await parseArgv(Init) |
| 141 | debug && logger.debug(`Parsed result: ${flags[flag]}`) |
| 142 | expect(flags[flag]).toBe(flagInput ?? true) |
| 143 | } |
| 144 | |
| 145 | export const initCommandPromptGetterMethodTester = async ( |
| 146 | spyFn: jest.SpyInstance, |
no test coverage detected