Skip to content

Commit

Permalink
Add unit tests for refresh_token
Browse files Browse the repository at this point in the history
  • Loading branch information
na2hiro committed Feb 17, 2024
1 parent b37dd79 commit 993eb03
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/Twitter2Strategy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ describe(Twitter2Strategy, () => {
token_type: "bearer",
expires_in: 7200,
access_token: "sth",
refresh_token: "refresh",
scope: "tweet.write",
}),
init: {
Expand All @@ -229,7 +230,7 @@ describe(Twitter2Strategy, () => {
);

verify.mockImplementationOnce(
({ accessToken, expiresIn, scope, context }) => {
({ accessToken, refreshToken, expiresIn, scope, context }) => {
return {
userName: fakeFetchUserName(accessToken),
};
Expand All @@ -251,6 +252,7 @@ describe(Twitter2Strategy, () => {

expect(verify).toHaveBeenLastCalledWith({
accessToken: "sth",
refreshToken: "refresh",
context: undefined,
expiresIn: 7200,
scope: "tweet.write",
Expand Down

0 comments on commit 993eb03

Please sign in to comment.