Skip to content

Commit

Permalink
chore: use jest fake timers
Browse files Browse the repository at this point in the history
  • Loading branch information
andreabadesso committed Jul 27, 2023
1 parent 70f86f4 commit fafdbbb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,10 @@ test('loadWallet API should fail if a wrong signature is sent', async () => {

test('loadWallet should fail if timestamp is shifted for more than 30s', async () => {
expect.hasAssertions();
const now = new Date('2020-01-01');
jest
.useFakeTimers()
.setSystemTime(now);

const event = makeGatewayEvent({}, JSON.stringify({
xpubkey: XPUBKEY,
Expand Down Expand Up @@ -1612,7 +1616,7 @@ test('POST /tx/proposal', async () => {
expect.hasAssertions();

await _testCORSHeaders(txProposalCreate, null, null);
}, 10000);
});

test('PUT /tx/proposal/{txProposalId}', async () => {
expect.hasAssertions();
Expand Down

0 comments on commit fafdbbb

Please sign in to comment.