Skip to content

Commit 62f823d

Browse files
deokjinkimtargos
authored andcommitted
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 ee4fc7d commit 62f823d

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
@@ -1545,7 +1545,7 @@ import { mock } from 'node:test';
15451545
mock.timers.enable(['setInterval']);
15461546
```
15471547

1548-
```js
1548+
```cjs
15491549
const { mock } = require('node:test');
15501550
mock.timers.enable(['setInterval']);
15511551
```
@@ -1582,7 +1582,7 @@ import { mock } from 'node:test';
15821582
mock.timers.reset();
15831583
```
15841584

1585-
```js
1585+
```cjs
15861586
const { mock } = require('node:test');
15871587
mock.timers.reset();
15881588
```
@@ -1631,7 +1631,7 @@ test('mocks setTimeout to be executed synchronously without having to actually w
16311631
});
16321632
```
16331633

1634-
```js
1634+
```cjs
16351635
const assert = require('node:assert');
16361636
const { test } = require('node:test');
16371637

@@ -1670,7 +1670,7 @@ test('mocks setTimeout to be executed synchronously without having to actually w
16701670
});
16711671
```
16721672

1673-
```js
1673+
```cjs
16741674
const assert = require('node:assert');
16751675
const { test } = require('node:test');
16761676

@@ -1714,7 +1714,7 @@ test('mocks setTimeout to be executed synchronously without having to actually w
17141714
});
17151715
```
17161716

1717-
```js
1717+
```cjs
17181718
const assert = require('node:assert');
17191719
const { test } = require('node:test');
17201720

@@ -1771,7 +1771,7 @@ test('mocks setTimeout to be executed synchronously without having to actually w
17711771
});
17721772
```
17731773

1774-
```js
1774+
```cjs
17751775
const assert = require('node:assert');
17761776
const { test } = require('node:test');
17771777
const nodeTimers = require('node:timers');
@@ -1833,7 +1833,7 @@ test('should tick five times testing a real use case', async (context) => {
18331833
});
18341834
```
18351835

1836-
```js
1836+
```cjs
18371837
const assert = require('node:assert');
18381838
const { test } = require('node:test');
18391839
const nodeTimersPromises = require('node:timers/promises');
@@ -1899,7 +1899,7 @@ test('runAll functions following the given order', (context) => {
18991899
});
19001900
```
19011901

1902-
```js
1902+
```cjs
19031903
const assert = require('node:assert');
19041904
const { test } = require('node:test');
19051905

0 commit comments

Comments
 (0)