We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Function using global as this
1 parent b4dac78 commit fcb88daCopy full SHA for fcb88da
test/unit/functions/functions.spec.ts
@@ -410,17 +410,17 @@ test("Function local overriding export", () => {
410
});
411
412
test("Function using global as this", () => {
413
+ // Value is provided with top-level return with ts-ignore, because modules are always strict.
414
+ // TODO: Provide a different builder kind for such tests?
415
util.testModule`
416
(globalThis as any).foo = "foo";
417
function bar(this: any) {
418
return this.foo;
419
}
420
- export const result = bar();
- `
421
- .setOptions({ alwaysStrict: false })
422
- .setReturnExport("result")
423
- .expectToEqual("foo");
+ // @ts-ignore
+ return bar();
+ `.expectToEqual("foo");
424
425
426
test("Function rest binding pattern", () => {
0 commit comments