Skip to content

Commit 8577e50

Browse files
committed
fix: Fixed test and plain reporter
1 parent 55dd186 commit 8577e50

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/ui/reporters/plain-reporter.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ export class PlainReporter implements Reporter {
2525
}
2626
}
2727

28+
async displayImportWarning(requiresParameters: string[], noParametersRequired: string[]): Promise<void> {
29+
console.log(chalk.bold('Additional information is required to continue import'))
30+
console.log('Some of the resources specified in the import support multiple instances. Additional information is required to identify the specific instance to import. If importing multiple instances is desired (for ex: multiple git clones) additional imports can be added in the prompt.')
31+
}
32+
2833
async promptOptions(message: string, options: string[]): Promise<number> {
2934
console.log(message);
3035
console.log('')

test/orchestrator/mocks/reporter.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export interface MockReporterConfig {
1717
promptUserForValues?: (resourceInfo: ResourceInfo[]) => Promise<ResourceConfig[]> | ResourceConfig[];
1818
displayImportResult?: (importResult: ImportResult, showConfigs: boolean) => Promise<void> | void;
1919
displayFileModifications?: (diff: { file: string; modification: FileModificationResult; }[]) => void,
20+
displayImportWarning?: (requiresParameters: string[], noParametersRequired: string[]) => void
2021
}
2122

2223
export class MockReporter implements Reporter {
@@ -26,6 +27,14 @@ export class MockReporter implements Reporter {
2627
this.config = config ?? null;
2728
}
2829

30+
async displayImportWarning(requiresParameters: string[], noParametersRequired: string[]): Promise<void> {
31+
console.log('Display import warning');
32+
console.log(requiresParameters);
33+
console.log(noParametersRequired);
34+
35+
this.config?.displayImportWarning?.(requiresParameters, noParametersRequired);
36+
}
37+
2938
async promptOptions(message: string, options: string[]): Promise<number> {
3039
return this.config?.promptOptions?.(message, options) ?? 0;
3140
}

0 commit comments

Comments
 (0)