Skip to content

Commit 935dfe2

Browse files
deokjinkimUlisesGascon
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 9fac310 commit 935dfe2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

doc/api/test.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,7 +1608,7 @@ import { mock } from 'node:test';
16081608
mock.timers.enable(['setInterval']);
16091609
```
16101610

1611-
```js
1611+
```cjs
16121612
const { mock } = require('node:test');
16131613
mock.timers.enable(['setInterval']);
16141614
```
@@ -1645,7 +1645,7 @@ import { mock } from 'node:test';
16451645
mock.timers.reset();
16461646
```
16471647

1648-
```js
1648+
```cjs
16491649
const { mock } = require('node:test');
16501650
mock.timers.reset();
16511651
```
@@ -1694,7 +1694,7 @@ test('mocks setTimeout to be executed synchronously without having to actually w
16941694
});
16951695
```
16961696

1697-
```js
1697+
```cjs
16981698
const assert = require('node:assert');
16991699
const { test } = require('node:test');
17001700

@@ -1733,7 +1733,7 @@ test('mocks setTimeout to be executed synchronously without having to actually w
17331733
});
17341734
```
17351735

1736-
```js
1736+
```cjs
17371737
const assert = require('node:assert');
17381738
const { test } = require('node:test');
17391739

@@ -1777,7 +1777,7 @@ test('mocks setTimeout to be executed synchronously without having to actually w
17771777
});
17781778
```
17791779

1780-
```js
1780+
```cjs
17811781
const assert = require('node:assert');
17821782
const { test } = require('node:test');
17831783

@@ -1834,7 +1834,7 @@ test('mocks setTimeout to be executed synchronously without having to actually w
18341834
});
18351835
```
18361836

1837-
```js
1837+
```cjs
18381838
const assert = require('node:assert');
18391839
const { test } = require('node:test');
18401840
const nodeTimers = require('node:timers');
@@ -1896,7 +1896,7 @@ test('should tick five times testing a real use case', async (context) => {
18961896
});
18971897
```
18981898

1899-
```js
1899+
```cjs
19001900
const assert = require('node:assert');
19011901
const { test } = require('node:test');
19021902
const nodeTimersPromises = require('node:timers/promises');
@@ -1962,7 +1962,7 @@ test('runAll functions following the given order', (context) => {
19621962
});
19631963
```
19641964

1965-
```js
1965+
```cjs
19661966
const assert = require('node:assert');
19671967
const { test } = require('node:test');
19681968

0 commit comments

Comments
 (0)