Skip to content

Commit

Permalink
βœ… fix test case about window reference binding (#1529)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuitos authored Jun 22, 2021
1 parent a971297 commit 916d1a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sandbox/__tests__/proxySandbox.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,14 +349,14 @@ it('should return true while [[GetPrototypeOf]] invoked by proxy object', () =>
});

it('native window function calling should always be bound with window', () => {
const { proxy } = new ProxySandbox('mustBeBoundWithWindowReference');
proxy.nativeWindowFunction = function nativeWindowFunction(this: any) {
window.nativeWindowFunction = function nativeWindowFunction(this: any) {
if (this !== undefined && this !== window) {
throw new Error('Illegal Invocation!');
}

return 'success';
};

const { proxy } = new ProxySandbox('mustBeBoundWithWindowReference');
expect(proxy.nativeWindowFunction()).toBe('success');
});

1 comment on commit 916d1a2

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for qiankun ready!

βœ… Preview
https://qiankun-95xpq9b1b-umijs.vercel.app

Built with commit 916d1a2.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.