Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fee0601

Browse files
authoredAug 26, 2023
doc: use cjs as block code's type in MockTimers
Use `cjs` instead of `js` to show toggle button between CJS and ESM because corresponding example using `mjs` exists. PR-URL: #49309 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Raz Luvaton <rluvaton@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 76e659a commit fee0601

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed
 

‎doc/api/test.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -1593,7 +1593,7 @@ import { mock } from 'node:test';
15931593
mock.timers.enable(['setInterval']);
15941594
```
15951595

1596-
```js
1596+
```cjs
15971597
const { mock } = require('node:test');
15981598
mock.timers.enable(['setInterval']);
15991599
```
@@ -1630,7 +1630,7 @@ import { mock } from 'node:test';
16301630
mock.timers.reset();
16311631
```
16321632

1633-
```js
1633+
```cjs
16341634
const { mock } = require('node:test');
16351635
mock.timers.reset();
16361636
```
@@ -1679,7 +1679,7 @@ test('mocks setTimeout to be executed synchronously without having to actually w
16791679
});
16801680
```
16811681

1682-
```js
1682+
```cjs
16831683
const assert = require('node:assert');
16841684
const { test } = require('node:test');
16851685

@@ -1718,7 +1718,7 @@ test('mocks setTimeout to be executed synchronously without having to actually w
17181718
});
17191719
```
17201720

1721-
```js
1721+
```cjs
17221722
const assert = require('node:assert');
17231723
const { test } = require('node:test');
17241724

@@ -1762,7 +1762,7 @@ test('mocks setTimeout to be executed synchronously without having to actually w
17621762
});
17631763
```
17641764

1765-
```js
1765+
```cjs
17661766
const assert = require('node:assert');
17671767
const { test } = require('node:test');
17681768

@@ -1819,7 +1819,7 @@ test('mocks setTimeout to be executed synchronously without having to actually w
18191819
});
18201820
```
18211821

1822-
```js
1822+
```cjs
18231823
const assert = require('node:assert');
18241824
const { test } = require('node:test');
18251825
const nodeTimers = require('node:timers');
@@ -1881,7 +1881,7 @@ test('should tick five times testing a real use case', async (context) => {
18811881
});
18821882
```
18831883

1884-
```js
1884+
```cjs
18851885
const assert = require('node:assert');
18861886
const { test } = require('node:test');
18871887
const nodeTimersPromises = require('node:timers/promises');
@@ -1947,7 +1947,7 @@ test('runAll functions following the given order', (context) => {
19471947
});
19481948
```
19491949

1950-
```js
1950+
```cjs
19511951
const assert = require('node:assert');
19521952
const { test } = require('node:test');
19531953

0 commit comments

Comments
 (0)
Please sign in to comment.