Skip to content

Commit

Permalink
minor fix + test adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
ctot-nondef committed Jan 11, 2024
1 parent 114be90 commit 0410a4b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/oai-pmh-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export async function* getOaiListItems(
| TOAIListIdenfifiersResponse
| TOAIListRecordsResponse
| TOAIListSetsResponse;
for (const item of result[field]) {
for (const item of result[0][field]) {
yield item;
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/oai-pmh.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ describe("OaiPmh", () => {
it("should list metadata formats for arxiv", async () => {
const oaiPmh = new OaiPmh(arxivBaseUrl as unknown as URL);
const res = await oaiPmh.listMetadataFormats({});
expect(res.length).to.equal(4);
expect(res[0].metadataFormat.length).to.equal(4);
});
it("should list metadata formats for arxiv id 1208.0264", async () => {
const oaiPmh = new OaiPmh(arxivBaseUrl as unknown as URL);
const res = await oaiPmh.listMetadataFormats({
identifier: "oai:arXiv.org:1208.0264",
});
expect(res.length).to.equal(4);
expect(res[0].metadataFormat.length).to.equal(4);
});

it("should fail for non-existent arxiv id lolcat", async () => {
Expand Down

0 comments on commit 0410a4b

Please sign in to comment.