diff --git a/doc/api/test.md b/doc/api/test.md index a4936c0b72c35e..de5515fa53ad4b 100644 --- a/doc/api/test.md +++ b/doc/api/test.md @@ -1545,7 +1545,7 @@ import { mock } from 'node:test'; mock.timers.enable(['setInterval']); ``` -```js +```cjs const { mock } = require('node:test'); mock.timers.enable(['setInterval']); ``` @@ -1582,7 +1582,7 @@ import { mock } from 'node:test'; mock.timers.reset(); ``` -```js +```cjs const { mock } = require('node:test'); mock.timers.reset(); ``` @@ -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'); @@ -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'); @@ -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'); @@ -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'); @@ -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'); @@ -1899,7 +1899,7 @@ test('runAll functions following the given order', (context) => { }); ``` -```js +```cjs const assert = require('node:assert'); const { test } = require('node:test');