Skip to content

Commit

Permalink
Add tests for validate function (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
w4ll3 committed Jul 18, 2022
1 parent c3f76d2 commit f65e540
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/siwe/lib/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,15 @@ describe(`Message verification without suppressExceptions`, () => {
domain: (test_fields as any).domainBinding,
nonce: (test_fields as any).matchNonce,
})
.then(({ success }) => success)
// when validate is removed uncomment this and remove the following then
// .then(({ success }) => success)
.then(async ({ data }) => {
jest
.useFakeTimers()
.setSystemTime(new Date((test_fields as any).time || test_fields.issuedAt));
const res = await msg.validate(test_fields.signature);
return res === data;
})
).resolves.toBeTruthy();
}
);
Expand Down

0 comments on commit f65e540

Please sign in to comment.