diff --git a/exercises/03.async/01.solution.await/README.mdx b/exercises/03.async/01.solution.await/README.mdx index f5b55fa..c8aa8c3 100644 --- a/exercises/03.async/01.solution.await/README.mdx +++ b/exercises/03.async/01.solution.await/README.mdx @@ -10,6 +10,10 @@ This will allow me to await the `callback()` if it happens to be `async` too. +To let TypeScript know that `callback` is now, potentially, an asynchronous function, I will adjust its return type to include `Promise`: + + + If I run the tests now, I can correctly see the assertion on `greetByResponse()` failing the relevant test: ```txt nocopy nonumber lines=3-4 diff --git a/exercises/03.async/02.problem.rejections/setup.ts b/exercises/03.async/02.problem.rejections/setup.ts index 0611a84..551504a 100644 --- a/exercises/03.async/02.problem.rejections/setup.ts +++ b/exercises/03.async/02.problem.rejections/setup.ts @@ -10,7 +10,7 @@ interface Assertions { declare global { var expect: (actual: unknown) => Assertions - var test: (title: string, callback: () => void) => void + var test: (title: string, callback: () => void | Promise) => void var beforeAll: (callback: () => void) => void var afterAll: (callback: () => void) => void } diff --git a/exercises/03.async/02.solution.rejections/setup.ts b/exercises/03.async/02.solution.rejections/setup.ts index 070bae0..25e51ad 100644 --- a/exercises/03.async/02.solution.rejections/setup.ts +++ b/exercises/03.async/02.solution.rejections/setup.ts @@ -7,7 +7,7 @@ interface Assertions { declare global { var expect: (actual: unknown) => Assertions - var test: (title: string, callback: () => void) => void + var test: (title: string, callback: () => void | Promise) => void var beforeAll: (callback: () => void) => void var afterAll: (callback: () => void) => void } diff --git a/exercises/03.async/03.problem.waitFor/setup.ts b/exercises/03.async/03.problem.waitFor/setup.ts index 4158cc6..e32471e 100644 --- a/exercises/03.async/03.problem.waitFor/setup.ts +++ b/exercises/03.async/03.problem.waitFor/setup.ts @@ -7,7 +7,7 @@ interface Assertions { declare global { var expect: (actual: unknown) => Assertions - var test: (title: string, callback: () => void) => void + var test: (title: string, callback: () => void | Promise) => void var beforeAll: (callback: () => void) => void var afterAll: (callback: () => void) => void } diff --git a/exercises/03.async/03.solution.waitFor/setup.ts b/exercises/03.async/03.solution.waitFor/setup.ts index 4158cc6..e32471e 100644 --- a/exercises/03.async/03.solution.waitFor/setup.ts +++ b/exercises/03.async/03.solution.waitFor/setup.ts @@ -7,7 +7,7 @@ interface Assertions { declare global { var expect: (actual: unknown) => Assertions - var test: (title: string, callback: () => void) => void + var test: (title: string, callback: () => void | Promise) => void var beforeAll: (callback: () => void) => void var afterAll: (callback: () => void) => void } diff --git a/exercises/04.vitest/01.problem.using-vitest/setup.ts b/exercises/04.vitest/01.problem.using-vitest/setup.ts index 4158cc6..e32471e 100644 --- a/exercises/04.vitest/01.problem.using-vitest/setup.ts +++ b/exercises/04.vitest/01.problem.using-vitest/setup.ts @@ -7,7 +7,7 @@ interface Assertions { declare global { var expect: (actual: unknown) => Assertions - var test: (title: string, callback: () => void) => void + var test: (title: string, callback: () => void | Promise) => void var beforeAll: (callback: () => void) => void var afterAll: (callback: () => void) => void }