Skip to content

Commit 8cd4bfa

Browse files
committed
docs: fix assertions example to use closure macro syntax
The verify field should use closure(...) macro, not the expanded { expression, references } form. This matches the Watch Mode example and shows users the correct API.
1 parent 640240f commit 8cd4bfa

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

README.md

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -220,30 +220,24 @@ export default async () => {
220220
```typescript
221221
import {
222222
assertThat, is, not, both, contains, matches,
223-
greaterThan, lessThan, scenario, runScenarios, log
223+
greaterThan, lessThan, scenario, runScenarios, closure, log
224224
} from "funee";
225225

226226
const scenarios = [
227227
scenario({
228228
description: "string assertions",
229-
verify: {
230-
expression: async () => {
231-
await assertThat("hello world", contains("world"));
232-
await assertThat("test@example.com", matches(/^[\w]+@[\w]+\.\w+$/));
233-
},
234-
references: new Map(),
235-
},
229+
verify: closure(async () => {
230+
await assertThat("hello world", contains("world"));
231+
await assertThat("test@example.com", matches(/^[\w]+@[\w]+\.\w+$/));
232+
}),
236233
}),
237234
scenario({
238235
description: "numeric comparisons",
239-
verify: {
240-
expression: async () => {
241-
await assertThat(10, greaterThan(5));
242-
await assertThat(3, lessThan(10));
243-
await assertThat(42, both(greaterThan(0), lessThan(100)));
244-
},
245-
references: new Map(),
246-
},
236+
verify: closure(async () => {
237+
await assertThat(10, greaterThan(5));
238+
await assertThat(3, lessThan(10));
239+
await assertThat(42, both(greaterThan(0), lessThan(100)));
240+
}),
247241
}),
248242
];
249243

0 commit comments

Comments
 (0)