Skip to content

Commit

Permalink
fix verifyFieldsHash test for node 16
Browse files Browse the repository at this point in the history
  • Loading branch information
ovx committed Jul 24, 2024
1 parent fd2817c commit ab7b055
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/fieldshash.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ if (!('crypto' in globalThis)) {
globalThis.crypto = require('node:crypto').webcrypto;
}

if (!('FormData' in globalThis)) {
// Node.js 16 doesn't have FormData, mock using URLSearchParams
// @ts-expect-error Blob type
globalThis.FormData = URLSearchParams;
}

const formData = new FormData();
formData.append('field1', 'value1');
formData.append('field2', 'value2');
Expand Down

0 comments on commit ab7b055

Please sign in to comment.