total-typescript / advanced-patterns-workshop

An interactive TypeScript repo on advanced patterns (WIP)
1.33k stars 201 forks source link

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

Open boltex opened 10 months ago

boltex commented 10 months ago

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.