Skip to content

Commit f65e540

Browse files
committed
Add tests for validate function (#88)
1 parent c3f76d2 commit f65e540

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

packages/siwe/lib/client.test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,15 @@ describe(`Message verification without suppressExceptions`, () => {
5555
domain: (test_fields as any).domainBinding,
5656
nonce: (test_fields as any).matchNonce,
5757
})
58-
.then(({ success }) => success)
58+
// when validate is removed uncomment this and remove the following then
59+
// .then(({ success }) => success)
60+
.then(async ({ data }) => {
61+
jest
62+
.useFakeTimers()
63+
.setSystemTime(new Date((test_fields as any).time || test_fields.issuedAt));
64+
const res = await msg.validate(test_fields.signature);
65+
return res === data;
66+
})
5967
).resolves.toBeTruthy();
6068
}
6169
);

0 commit comments

Comments
 (0)