Skip to content

Commit fcb88da

Browse files
committed
Fix Function using global as this test
1 parent b4dac78 commit fcb88da

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/unit/functions/functions.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -410,17 +410,17 @@ test("Function local overriding export", () => {
410410
});
411411

412412
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?
413415
util.testModule`
414416
(globalThis as any).foo = "foo";
415417
function bar(this: any) {
416418
return this.foo;
417419
}
418420
419-
export const result = bar();
420-
`
421-
.setOptions({ alwaysStrict: false })
422-
.setReturnExport("result")
423-
.expectToEqual("foo");
421+
// @ts-ignore
422+
return bar();
423+
`.expectToEqual("foo");
424424
});
425425

426426
test("Function rest binding pattern", () => {

0 commit comments

Comments
 (0)