Skip to content

Commit 3a0a8f8

Browse files
committed
Trim response from get compute envs response.
1 parent 8dcd878 commit 3a0a8f8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

test/computeFlow.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,14 @@ describe("Ocean CLI Compute", function() {
138138
console.error("Raw output:", output);
139139
throw new Error("Could not find compute environments in the output");
140140
}
141+
const match = jsonMatch[0].match(/Exiting compute environments:\s*(.*)/s);
142+
const result = match ? match[1].trim() : null;
141143

142144
let environments;
143145
try {
144-
environments = eval(`(${jsonMatch[0]})`);
146+
environments = eval(result);
145147
} catch (error) {
146-
console.error("Extracted output:", jsonMatch[0]);
148+
console.error(`Extracted output: ${jsonMatch[0]} and final result: ${result}`);
147149
throw new Error("Failed to parse the extracted output:\n" + error);
148150
}
149151

0 commit comments

Comments
 (0)