You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/site/pages/en/learn/test-runner/using-test-runner.md
+26-24Lines changed: 26 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,47 +68,49 @@ Each example below was taken from real-world projects; they may not be appropria
68
68
69
69
Some times, you may want to dynamically generate test-cases. For instance, you want to test the same thing across a bunch of files. This is possible, albeit slightly arcane. You must use `test` (you cannot use `describe`) + `testContext.test`:
70
70
71
-
```js displayName="simple example (prior to 23.8.0)"
71
+
### Simple example
72
+
73
+
```js displayName="23.8.0 and later"
72
74
importassertfrom'node:assert/strict';
73
75
import { test } from'node:test';
74
76
75
77
import { detectOsInUserAgent } from'…';
76
78
77
79
constuserAgents= [
78
-
{ ua:'…', os:'WIN' },
80
+
{ ua:/* … */, os:'WIN' },
79
81
// …
80
82
];
81
83
82
-
test('Detect OS via user-agent', { concurrency:true }, asynct=> {
83
-
constcases=userAgents.map(({ os, ua }) => {
84
+
test('Detect OS via user-agent', { concurrency:true }, t=> {
0 commit comments