Skip to content

Commit

Permalink
test: test swedish dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
jenspots committed Jun 21, 2024
1 parent eb499fa commit 229b99a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,12 @@ export async function httpFetch(
}

// Push the data down the pipeline.
const body = await res.text();
await writer.push(body);
try {
const body = await res.text();
await writer.push(body);
} catch (e) {
console.error(e);
}
};

// Executes each individual request and groups them into a single promise.
Expand Down
19 changes: 19 additions & 0 deletions tests/online/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,23 @@ describe("Real world datasets", () => {

return expect(func()).resolves.toBeUndefined();
});

test(
"Swedish - success",
async () => {
const writeStream = writer((output) => {
console.log(
`Size of incoming data: ${output.length} characters.`,
);
});

const func = await httpFetch(
"https://admin.dataportal.se/all.rdf",
writeStream,
);

return expect(func()).resolves.toBeUndefined();
},
60 * 1000,
);
});

0 comments on commit 229b99a

Please sign in to comment.