Skip to content

Commit

Permalink
doc: use cjs as block code's type in MockTimers
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
deokjinkim authored Aug 26, 2023
1 parent 76e659a commit fee0601
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions doc/api/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -1593,7 +1593,7 @@ import { mock } from 'node:test';
mock.timers.enable(['setInterval']);
```

```js
```cjs
const { mock } = require('node:test');
mock.timers.enable(['setInterval']);
```
Expand Down Expand Up @@ -1630,7 +1630,7 @@ import { mock } from 'node:test';
mock.timers.reset();
```

```js
```cjs
const { mock } = require('node:test');
mock.timers.reset();
```
Expand Down Expand Up @@ -1679,7 +1679,7 @@ test('mocks setTimeout to be executed synchronously without having to actually w
});
```

```js
```cjs
const assert = require('node:assert');
const { test } = require('node:test');

Expand Down Expand Up @@ -1718,7 +1718,7 @@ test('mocks setTimeout to be executed synchronously without having to actually w
});
```

```js
```cjs
const assert = require('node:assert');
const { test } = require('node:test');

Expand Down Expand Up @@ -1762,7 +1762,7 @@ test('mocks setTimeout to be executed synchronously without having to actually w
});
```

```js
```cjs
const assert = require('node:assert');
const { test } = require('node:test');

Expand Down Expand Up @@ -1819,7 +1819,7 @@ test('mocks setTimeout to be executed synchronously without having to actually w
});
```

```js
```cjs
const assert = require('node:assert');
const { test } = require('node:test');
const nodeTimers = require('node:timers');
Expand Down Expand Up @@ -1881,7 +1881,7 @@ test('should tick five times testing a real use case', async (context) => {
});
```

```js
```cjs
const assert = require('node:assert');
const { test } = require('node:test');
const nodeTimersPromises = require('node:timers/promises');
Expand Down Expand Up @@ -1947,7 +1947,7 @@ test('runAll functions following the given order', (context) => {
});
```

```js
```cjs
const assert = require('node:assert');
const { test } = require('node:test');

Expand Down

0 comments on commit fee0601

Please sign in to comment.