Skip to content

Commit ec8773d

Browse files
committed
exercise corrections
1 parent 1f064ed commit ec8773d

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.vscode/extensions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"recommendations": [
33
"dbaeumer.vscode-eslint",
44
"esbenp.prettier-vscode",
5-
"neotan.vscode-auto-restart-typescript-eslint-servers"
5+
"neotan.vscode-auto-restart-typescript-eslint-servers",
6+
"qwtel.sqlite-viewer"
67
]
78
}

exercises/02.context/02.problem.automatic-fixtures/README.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ Your custom fixtures can introduce side effects that run before and after the fi
66
import fs from 'node:fs'
77
import os from 'node:os'
88
import path from 'node:path'
9+
import { test as testBase } from 'vitest'
910

1011
interface Fixtures {
11-
createMockFile: (content: string, filename: string) => Promise<void>
12+
createMockFile: (content: string, filename: string) => Promise<string>
1213
}
1314

14-
test.extend({
15+
const test = testBase.extend<Fixtures>({
1516
async createMockFile({}, use) {
1617
// 1. Prepare.
1718
const temporaryDirectory = await fs.promises.mkdtemp(

exercises/03.assertions/04.problem.retryable-assertions/README.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ In Promise-based APIs, that expectation is neatly abstracted behind the `async`/
66

77
```ts nonumber
88
const response = await fetch('/api/songs')
9-
await expect(response.json()).toEqual(favoriteSongs)
9+
await expect(response.json()).resolves.toEqual(favoriteSongs)
1010
```
1111

1212
> While fetching the list of songs takes time, that eventuality is represented as a Promise that you can `await`. This guaratees that your test will not continue until the data is fetched. Quite the same applies to reading the response body stream.

0 commit comments

Comments
 (0)