Skip to content

Commit 017dd08

Browse files
committed
Fixed 08 solution
1 parent ec810db commit 017dd08

File tree

3 files changed

+6
-54
lines changed

3 files changed

+6
-54
lines changed

scripts/tests/__snapshots__/all.test.ts.snap

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ src/07-challenges/34-dynamic-reducer.problem.ts(86,23): error TS2344: Type 'fals
117117
src/07-challenges/34-dynamic-reducer.problem.ts(95,7): error TS2578: Unused '@ts-expect-error' directive.
118118
src/07-challenges/34-dynamic-reducer.problem.ts(104,5): error TS2578: Unused '@ts-expect-error' directive.
119119
src/07-challenges/38-challenge-custom-jsx-element.problem.tsx(13,17): error TS2339: Property 'custom-element' does not exist on type 'JSX.IntrinsicElements'.
120+
src/07-challenges/38-challenge-custom-jsx-element.problem.tsx(13,17): error TS17004: Cannot use JSX unless the '--jsx' flag is provided.
120121
src/07-challenges/38-challenge-custom-jsx-element.problem.tsx(13,44): error TS2339: Property 'custom-element' does not exist on type 'JSX.IntrinsicElements'.
122+
src/07-challenges/38-challenge-custom-jsx-element.solution.tsx(18,17): error TS17004: Cannot use JSX unless the '--jsx' flag is provided.
121123
,"
122124
`;
123125
@@ -482,21 +484,6 @@ exports[`vitest > Should have the correct Vitest errors 1`] = `
482484
"status": "failed",
483485
"title": "Should let you call makeGreeting from the window object",
484486
},
485-
{
486-
"ancestorTitles": [
487-
"",
488-
],
489-
"failureMessages": [
490-
"expected [Function] to be undefined // Object.is equality",
491-
],
492-
"fullName": " Should not be available on globalThis",
493-
"location": {
494-
"column": 5,
495-
"line": 25,
496-
},
497-
"status": "failed",
498-
"title": "Should not be available on globalThis",
499-
},
500487
],
501488
"message": "",
502489
"name": "src/02-globals/08-add-to-window.problem.ts",
@@ -508,36 +495,15 @@ exports[`vitest > Should have the correct Vitest errors 1`] = `
508495
"ancestorTitles": [
509496
"",
510497
],
511-
"failureMessages": [
512-
"expected 'Hello!' to be 'Hello, world!' // Object.is equality",
513-
],
498+
"failureMessages": [],
514499
"fullName": " Should let you call makeGreetingSolution from the window object",
515-
"location": {
516-
"column": 41,
517-
"line": 21,
518-
},
519-
"status": "failed",
500+
"status": "passed",
520501
"title": "Should let you call makeGreetingSolution from the window object",
521502
},
522-
{
523-
"ancestorTitles": [
524-
"",
525-
],
526-
"failureMessages": [
527-
"expected [Function] to be undefined // Object.is equality",
528-
],
529-
"fullName": " Should not be available on globalThis",
530-
"location": {
531-
"column": 5,
532-
"line": 30,
533-
},
534-
"status": "failed",
535-
"title": "Should not be available on globalThis",
536-
},
537503
],
538504
"message": "",
539505
"name": "src/02-globals/08-add-to-window.solution.ts",
540-
"status": "failed",
506+
"status": "passed",
541507
},
542508
{
543509
"assertionResults": [

src/02-globals/08-add-to-window.problem.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,3 @@ it("Should let you call makeGreeting from the window object", () => {
1717

1818
type test1 = Expect<Equal<typeof window.makeGreeting, () => string>>;
1919
});
20-
21-
it("Should not be available on globalThis", () => {
22-
expect(
23-
// @ts-expect-error
24-
globalThis.makeGreeting,
25-
).toBe(undefined);
26-
});

src/02-globals/08-add-to-window.solution.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,10 @@ declare global {
1515
}
1616
}
1717

18-
window.makeGreetingSolution = () => "Hello!";
18+
window.makeGreetingSolution = () => "Hello, world!";
1919

2020
it("Should let you call makeGreetingSolution from the window object", () => {
2121
expect(window.makeGreetingSolution()).toBe("Hello, world!");
2222

2323
type test1 = Expect<Equal<typeof window.makeGreetingSolution, () => string>>;
2424
});
25-
26-
it("Should not be available on globalThis", () => {
27-
expect(
28-
// @ts-expect-error
29-
globalThis.makeGreetingSolution,
30-
).toBe(undefined);
31-
});

0 commit comments

Comments
 (0)