From 12fce587e976f1ebd6bdcc393f4fa23ec7b811ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20Ara=C3=BAjo?= Date: Thu, 24 Apr 2025 23:23:53 -0300 Subject: [PATCH 1/2] fix: lint snippets glob --- apps/site/scripts/lint-snippets/index.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/site/scripts/lint-snippets/index.mjs b/apps/site/scripts/lint-snippets/index.mjs index fd155ce33a774..266dba933555b 100755 --- a/apps/site/scripts/lint-snippets/index.mjs +++ b/apps/site/scripts/lint-snippets/index.mjs @@ -79,10 +79,12 @@ function reportErrors(errors) { // Get all markdown files const filePaths = await glob('**/*.md', { root: process.cwd(), - cwd: 'apps/site/pages/en/learn/', + cwd: 'pages/en/learn/', absolute: true, }); +console.log(`Found ${filePaths.length} markdown files.`); + // Validate all files and collect errors const allErrors = await Promise.all(filePaths.map(validateFile)); From a1a230075a835d46edce4ded0c072aab5d19a136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20Ara=C3=BAjo?= Date: Thu, 24 Apr 2025 23:24:43 -0300 Subject: [PATCH 2/2] fix: snippet syntax --- apps/site/pages/en/learn/test-runner/using-test-runner.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/site/pages/en/learn/test-runner/using-test-runner.md b/apps/site/pages/en/learn/test-runner/using-test-runner.md index 155e710b8eba0..4d634b52b8c06 100644 --- a/apps/site/pages/en/learn/test-runner/using-test-runner.md +++ b/apps/site/pages/en/learn/test-runner/using-test-runner.md @@ -77,12 +77,15 @@ import { test } from 'node:test'; import { detectOsInUserAgent } from '…'; const userAgents = [ - { ua: /* … */, os: 'WIN' }, + { + ua: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.3', + os: 'WIN', + }, // … ]; test('Detect OS via user-agent', { concurrency: true }, t => { - for (const { os, ua } from userAgents) { + for (const { os, ua } of userAgents) { t.test(ua, () => assert.equal(detectOsInUserAgent(ua), os)); } });