advanced-patterns-workshop icon indicating copy to clipboard operation
advanced-patterns-workshop copied to clipboard

Part of problem tests missing for the 'Add Functionality to Existing Global Interfaces' problem

Open boltex opened this issue 1 year ago • 0 comments
trafficstars

https://github.com/total-typescript/advanced-patterns-workshop/blob/84bdf1fd4cf070f6ffc5213e24f9176468ea7423/src/02-globals/08-add-to-window.problem.ts#L19

This last part is missing from the problem's tests at the bottom. (It's visible in the solutions video and in the problem's description on the side.

it("Should not be available on globalThis", () => {
  expect(
    // @ts-expect-error
    globalThis.makeGreeting,
  ).toBe(undefined);
});

Edit: After adding this part and trying it out, I see it's not totally appropriate - perhaps typescript has changed its behavior in the past few updates.

boltex avatar Nov 23 '23 23:11 boltex