Skip to content

Commit f8c9320

Browse files
committed
update regex
1 parent 98c1e0c commit f8c9320

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

test/compute.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,11 @@ describe("Ocean CLI Free Compute Flow", function () {
157157

158158
let jobs;
159159
try {
160-
jobs = JSON.parse(jsonMatch[0]);
160+
const jsonStr = jsonMatch[0]
161+
.replace(/([{,]\s*)'([^']+?)'\s*:/g, '$1"$2":')
162+
.replace(/:\s*'([^']*?)'/g, ': "$1"');
163+
164+
jobs = JSON.parse(jsonStr);
161165
} catch (e) {
162166
console.warn("Failed to parse job status JSON, will retry...");
163167
await new Promise((res) => setTimeout(res, pollIntervalMs));
@@ -182,9 +186,7 @@ describe("Ocean CLI Free Compute Flow", function () {
182186
`Job ${jobId} did not finish within ${maxWaitMs / 1000} seconds`
183187
);
184188
};
185-
186189
it("should download compute job results", async () => {
187-
// Wait for job to finish and get job details
188190
const job = await waitForJobCompletion(
189191
computeDatasetDid,
190192
jobId,

0 commit comments

Comments
 (0)