Skip to content

Commit 3d34f9e

Browse files
committed
Remove eval.
1 parent 018a8d6 commit 3d34f9e

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

test/computeFlow.test.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,8 @@ describe("Ocean CLI Compute", function() {
6464
const output = await runCommand(`npm run cli publish ${metadataFile}`);
6565

6666
const jsonMatch = output.match(/did:op:[a-f0-9]{64}/);
67-
console.log(`json match compute dataset: ${JSON.stringify(jsonMatch)}`)
68-
if (!jsonMatch) {
69-
console.error("Raw output:", output);
70-
throw new Error("Could not find compute environments in the output");
71-
}
72-
7367
try {
74-
computeDatasetDid = eval(`(${jsonMatch[0]})`);
68+
computeDatasetDid = jsonMatch[0];
7569
} catch (error) {
7670
console.error("Extracted output:", jsonMatch[0]);
7771
throw new Error("Failed to parse the extracted output:\n" + error);
@@ -95,7 +89,7 @@ describe("Ocean CLI Compute", function() {
9589
}
9690

9791
try {
98-
jsAlgoDid = eval(`(${jsonMatch[0]})`);
92+
jsAlgoDid = jsonMatch[0];
9993
} catch (error) {
10094
console.error("Extracted output:", jsonMatch[0]);
10195
throw new Error("Failed to parse the extracted output:\n" + error);

0 commit comments

Comments
 (0)