Skip to content

Commit

Permalink
test: pass all strategy options to auth factory
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Oct 28, 2020
1 parent 2bcebf7 commit 08cfd69
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1902,13 +1902,16 @@ test("factory auth option", async () => {
const appAuth = createAppAuth({
appId: APP_ID,
privateKey: PRIVATE_KEY,
extra1: "value1",
extra2: "value2",
});

const factory = jest.fn().mockReturnValue({ ok: true });

const customAuth = await appAuth({
type: "installation",
installationId: 123,
extra1: "auth overide",
factory,
});

Expand All @@ -1918,20 +1921,21 @@ test("factory auth option", async () => {
expect(Object.keys(factoryOptions).sort()).toStrictEqual([
"appId",
"cache",
"clientId",
"clientSecret",
"extra1",
"extra2",
"installationId",
"log",
"privateKey",
"request",
"timeDifference",
]);

expect(factoryOptions).toEqual(
expect.objectContaining({
appId: APP_ID,
privateKey: PRIVATE_KEY,
installationId: 123,
extra1: "auth overide",
extra2: "value2",
})
);
});

0 comments on commit 08cfd69

Please sign in to comment.