Skip to content

Commit de2c6c6

Browse files
ad-worldAnsh Chaturvedi
authored andcommitted
test: add error to array instead of exiting test process
DX-389
1 parent 8dc4164 commit de2c6c6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/openapi-generator/test/externalModuleApiSpec.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,25 +88,25 @@ async function testCase(
8888
}
8989
const sourceFile = project.get(ref.location);
9090
if (sourceFile === undefined) {
91-
console.error(`Could not find '${ref.name}' from '${ref.location}'`);
92-
process.exit(1);
91+
errors.push(`Could not find '${ref.name}' from '${ref.location}'`);
92+
break;
9393
}
9494

9595
const initE = findSymbolInitializer(project, sourceFile, ref.name);
9696
if (E.isLeft(initE)) {
97-
console.error(
97+
errors.push(
9898
`Could not find symbol '${ref.name}' in '${ref.location}': ${initE.left}`,
9999
);
100-
process.exit(1);
100+
break;
101101
}
102102
const [newSourceFile, init] = initE.right;
103103

104104
const codecE = parseCodecInitializer(project, newSourceFile, init);
105105
if (E.isLeft(codecE)) {
106-
console.error(
107-
`Could not parse codec '${ref.name}' in '${ref.location}': ${codecE.left}`,
106+
errors.push(
107+
`Could not parse codec '${ref.name}' in '${ref.location}': ${codecE.left}`,
108108
);
109-
process.exit(1);
109+
break;
110110
}
111111
components[ref.name] = codecE.right;
112112
queue.push(codecE.right);

0 commit comments

Comments
 (0)