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: nodejs/node#49309
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Raz Luvaton <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
sercher committed Apr 25, 2024
1 parent 3ac97a2 commit 6f1387b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions graal-nodejs/doc/api/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -1545,7 +1545,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 @@ -1582,7 +1582,7 @@ import { mock } from 'node:test';
mock.timers.reset();
```

```js
```cjs
const { mock } = require('node:test');
mock.timers.reset();
```
Expand Down Expand Up @@ -1631,7 +1631,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 @@ -1670,7 +1670,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 @@ -1714,7 +1714,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 @@ -1771,7 +1771,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 @@ -1833,7 +1833,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 @@ -1899,7 +1899,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 6f1387b

Please sign in to comment.