Skip to content

Commit

Permalink
fix: update FormData mock to return same proxy for form property
Browse files Browse the repository at this point in the history
  • Loading branch information
devin-ai-integration[bot] committed Dec 25, 2024
1 parent bfaa229 commit f32a4f4
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions tests/resources/drafts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,8 @@ jest.mock('formdata-node', () => {
const proxy = new Proxy(formDataMethods, {
get: (target: any, prop: string | symbol): any => {
if (prop === 'form') {
// Return a proxy for form property that has all the same methods
return new Proxy(
{},
{
get: (_: any, innerProp: string | symbol): any => {
return target[innerProp];
},
}
);
// Return the same proxy for form property to ensure all methods are accessible
return proxy;
}
return target[prop];
},
Expand Down

0 comments on commit f32a4f4

Please sign in to comment.