We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c2c7c70 commit 2c275d1Copy full SHA for 2c275d1
tests/resources/drafts.spec.ts
@@ -23,14 +23,16 @@ jest.mock('formdata-node', () => {
23
this._getAppendedData = () => appendedData;
24
25
// Create a proxy to handle both direct access and form property access
26
- return new Proxy(this, {
27
- get: (target, prop) => {
+ const proxyHandler = {
+ get: (target: any, prop: string | symbol) => {
28
if (prop === 'form') {
29
- return target;
+ // Return a new proxy for the form property to maintain the chain
30
+ return new Proxy(target, proxyHandler);
31
}
- return target[prop as keyof typeof target];
32
+ return target[prop];
33
},
- });
34
+ };
35
+ return new Proxy(this, proxyHandler);
36
}),
37
File: jest.fn().mockImplementation((content: any[], name: string) => ({
38
content,
0 commit comments