Skip to content

Commit

Permalink
fix: Fetcher interface data type (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
hakanson authored Jan 19, 2025
1 parent 0d8be0e commit 009436a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/https.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface Fetcher {
fetch: (
uri: string,
requestOptions?: FetchRequestOptions,
data?: Buffer
data?: ArrayBuffer
) => Promise<ArrayBuffer>;
}

Expand Down
24 changes: 24 additions & 0 deletions tests/vite-app/cypress/e2e/fetcher.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/// <reference types="cypress" />
import { SimpleFetcher } from "aws-jwt-verify/https";

describe("Fetcher", () => {
let tokenData;

beforeEach(() => {
cy.fixture("example-token-data.json").then((data) => {
tokenData = data;
});
});

it("Simple JSON fetcher works", () => {
cy.visit("/");

cy.fixture("example-JWKS.json").then((jwksData) => {
const fetcher = new SimpleFetcher();

fetcher.fetch(tokenData.JWKSURI).then((jwks) => {
expect(jwks).to.deep.equal(jwksData);
});
});
});
});
2 changes: 1 addition & 1 deletion tests/vite-app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"skipLibCheck": true
"skipLibCheck": false
},
"include": ["src"]
}

0 comments on commit 009436a

Please sign in to comment.