Skip to content

Commit f43f3ba

Browse files
committed
Updated test.
1 parent 21dd3b3 commit f43f3ba

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

test/computeFlow.test.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,14 @@ describe("Ocean CLI Compute", function() {
104104
console.error("Raw output:", output);
105105
throw new Error("Could not find compute environments in the output");
106106
}
107-
console.log(`jsonMatch: ${JSON.stringify(jsonMatch)}`)
107+
108108
try {
109-
const computeDataset = eval(`(${jsonMatch[1]})`);
110-
expect(computeDataset).to.be.an("object")
111-
expect(computeDataset.did).to.be.equal(computeDatasetDid)
109+
expect(jsonMatch).to.contain("Resolving Asset with DID:")
110+
expect(jsonMatch).to.contain(`id: '${computeDatasetDid}'`)
111+
expect(jsonMatch).to.contain(`'@context': [ 'https://w3id.org/did/v1' ]`)
112+
expect(jsonMatch).to.contain('indexedMetadata')
112113
} catch (error) {
113-
console.error("Extracted output:", jsonMatch[1]);
114+
console.error("Extracted output:", jsonMatch[0]);
114115
throw new Error("Failed to parse the extracted output:\n" + error);
115116
}
116117
});
@@ -125,11 +126,12 @@ describe("Ocean CLI Compute", function() {
125126
}
126127

127128
try {
128-
const jsAlgoDataset = eval(`(${jsonMatch[1]})`);
129-
expect(jsAlgoDataset).to.be.an("object")
130-
expect(jsAlgoDataset.did).to.be.equal(jsAlgoDid)
129+
expect(jsonMatch).to.contain("Resolving Asset with DID:")
130+
expect(jsonMatch).to.contain(`id: '${jsAlgoDid}'`)
131+
expect(jsonMatch).to.contain(`'@context': [ 'https://w3id.org/did/v1' ]`)
132+
expect(jsonMatch).to.contain('indexedMetadata')
131133
} catch (error) {
132-
console.error("Extracted output:", jsonMatch[1]);
134+
console.error("Extracted output:", jsonMatch[0]);
133135
throw new Error("Failed to parse the extracted output:\n" + error);
134136
}
135137
});
@@ -145,9 +147,9 @@ describe("Ocean CLI Compute", function() {
145147

146148
let environments;
147149
try {
148-
environments = eval(`(${jsonMatch[1]})`);
150+
environments = eval(`(${jsonMatch[0]})`);
149151
} catch (error) {
150-
console.error("Extracted output:", jsonMatch[1]);
152+
console.error("Extracted output:", jsonMatch[0]);
151153
throw new Error("Failed to parse the extracted output:\n" + error);
152154
}
153155

0 commit comments

Comments
 (0)