From d8caf2137ee69d89be04902dadff889ae8b2405c Mon Sep 17 00:00:00 2001 From: Deokjin Kim Date: Thu, 24 Aug 2023 23:47:19 +0900 Subject: [PATCH] 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. --- doc/api/test.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/api/test.md b/doc/api/test.md index 36f6851c6acf17..5b694a4dc74668 100644 --- a/doc/api/test.md +++ b/doc/api/test.md @@ -1593,7 +1593,7 @@ import { mock } from 'node:test'; mock.timers.enable(['setInterval']); ``` -```js +```cjs const { mock } = require('node:test'); mock.timers.enable(['setInterval']); ``` @@ -1630,7 +1630,7 @@ import { mock } from 'node:test'; mock.timers.reset(); ``` -```js +```cjs const { mock } = require('node:test'); mock.timers.reset(); ``` @@ -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'); @@ -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'); @@ -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'); @@ -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'); @@ -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'); @@ -1947,7 +1947,7 @@ test('runAll functions following the given order', (context) => { }); ``` -```js +```cjs const assert = require('node:assert'); const { test } = require('node:test');