Skip to content

Commit

Permalink
Fix FormData in Jest configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
wyne committed Jan 21, 2025
1 parent 69c4367 commit 97004c2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const config: Config = {
],
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
setupFiles: ['./jest.setup.js'],
setupFilesAfterEnv: [
'@testing-library/jest-native/extend-expect',
],
Expand Down
8 changes: 8 additions & 0 deletions jest.setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
global.FormData = class FormData {
constructor() {
this.data = [];
}
append(key, value) {
this.data.push({ key, value });
}
};

0 comments on commit 97004c2

Please sign in to comment.