Skip to content

docs: Fix documentation inconsistencies in documentation/ folder#37394

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-docs-inconsistencies
Draft

docs: Fix documentation inconsistencies in documentation/ folder#37394
Copilot wants to merge 2 commits intomainfrom
copilot/fix-docs-inconsistencies

Conversation

Copy link
Contributor

Copilot AI commented Feb 27, 2026

Fixes several stale/incorrect patterns in the documentation/ folder that conflict with the current tooling and test framework used in this repo.

Changes

  • Node.js version (Quickstart-on-how-to-write-tests.md, Generate-code-from-TypeSpec.md): "LTS versions of Node.js" → "Node.js 20 or later" to match package.json engines: { node: ">=20" }.

  • Test examples updated to vitest (Quickstart-on-how-to-write-tests.md): Both glossary.spec.ts and monitor.spec.ts doc examples used outdated mocha/chai patterns:

    • import { assert } from "chai"import { ..., assert, ... } from "vitest"
    • import { Context } from "mocha" removed; replaced with import type { TestInfo } from "@azure-tools/test-recorder"
    • new Recorder(context.currentTest)new Recorder(context)
    • beforeEach(async function (this: Context)beforeEach(async (ctx) =>
    • Non-type imports of recorder types → import type { RecorderStartOptions, TestInfo }
    • Module paths updated to use .js extensions
  • Shell command fix (resolve-pnpm-lock-merge-conflict.md): Missing / between git rev-parse --show-toplevel output and pnpm-lock.yaml in the combined one-liner.

  • Remove broken install command (steps-after-generations.md): Removed npm install -g common/tools/dev-tool — a local-path global install that doesn't work. npx dev-tool on the next line is sufficient.

Packages impacted by this PR

Documentation only — no package code changed.

Issues associated with this PR

N/A

Describe the problem that is addressed by this PR

Documentation examples referenced mocha/chai (removed from the repo in favor of vitest), used incorrect Node.js version requirements, had a broken shell command, and included a non-functional npm install -g invocation.

What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?

Straightforward corrections to match current repo conventions; no design alternatives.

Are there test cases added in this PR? (If not, why?)

No — documentation-only changes.

Provide a list of related PRs (if any)

N/A

Checklists

  • Added impacted package name to the issue description.
  • Does this PR need any fixes in the SDK Generator?** (If so, create an Issue in the Autorest/typescript repository and link it here.)
  • Added a changelog (if necessary).
Original prompt

This section details on the original issue you should resolve

<issue_title>[docs] Fix documentation inconsistencies in documentation/ folder</issue_title>
<issue_description>## Summary

This PR fixes several inconsistencies found between the documentation/ folder and the actual source code/tooling in this repository.


1. Node.js version requirement updated (Quickstart-on-how-to-write-tests.md, Generate-code-from-TypeSpec.md)

Issue: Both files said "Any/all of the LTS versions of Node.js" as a prerequisite.
Fix: Updated to "Node.js 20 or later" to match the package.json engines field ("node": ">=20").


2. Test examples updated from mocha/chai to vitest (Quickstart-on-how-to-write-tests.md)

Issue: The two test examples in the quickstart guide (glossary.spec.ts and monitor.spec.ts) used mocha/chai patterns that are no longer used in this repo:

  • import { assert } from "chai" — the repo uses assert from vitest
  • import { Context } from "mocha" — the repo uses TestInfo from @azure-tools/test-recorder
  • new Recorder(context.currentTest) — the vitest API is new Recorder(context) (no .currentTest)
  • beforeEach(async function (this: Context) — the vitest pattern is beforeEach(async (ctx) =>
  • import { Recorder, RecorderStartOptions } (non-type import) — should use import type for types

Fix: Updated both examples to reflect current vitest patterns, consistent with actual test files such as sdk/purview/purview-datamap-rest/test/public/glossary.spec.ts and sdk/monitor/arm-monitor/test/monitor.spec.ts.


3. Fix missing / in shell command (resolve-pnpm-lock-merge-conflict.md)

Issue: The combined shell command at the bottom of the file had a missing / separator between the git rev-parse --show-toplevel output and pnpm-lock.yaml:

# Before (broken):
git add `git rev-parse --show-toplevel`pnpm-lock.yaml

# After (fixed):
git add `git rev-parse --show-toplevel`/pnpm-lock.yaml

4. Remove incorrect npm install -g command for dev-tool (steps-after-generations.md)

Issue: The samples publishing instructions included npm install -g common/tools/dev-tool — a local path global install that does not work and references npm instead of pnpm.
Fix: Removed this line. npx dev-tool (already on the next line) is sufficient and correct since @azure/dev-tool is available as a devDependency in packages and via the pnpm workspace.

Generated by Documentation Consistency Check

  • expires on Mar 5, 2026, 11:42 PM UTC

[!NOTE]
This was originally intended as a pull request, but the git push operation failed.

Workflow Run: View run details and download patch artifact

The patch file is available in the agent-artifacts artifact in the workflow run linked above.

To apply the patch locally:

# Download the artifact from the workflow run https://github.com/Azure/azure-sdk-for-js/actions/runs/22464961098
# (Use GitHub MCP tools if gh CLI is not available)
gh run download 22464961098 -n agent-artifacts

# The patch file will be at agent-artifacts/tmp/gh-aw/aw.patch after download
# Apply the patch
git am agent-artifacts/tmp/gh-aw/aw.patch
Show patch preview (184 of 184 lines)
From e638ba6cae599893af4cef520f2f0ff77151e8b9 Mon Sep 17 00:00:00 2001
From: GitHub Copilot <copilot@github.com>
Date: Thu, 26 Feb 2026 23:23:23 +0000
Subject: [PATCH] Fix documentation inconsistencies in documentation/ folder

- Update Node.js version requirement from 'LTS versions' to 'Node.js 20 or
  later' in Quickstart-on-how-to-write-tests.md and
  Generate-code-from-TypeSpec.md (aligns with package.json engines node>=20)
- Fix test examples in Quickstart-on-how-to-write-tests.md to use vitest
  instead of mocha/chai patterns:
  - Replace `import { assert } from "chai"` with vitest import
  - Replace `import { Context } from "mocha"` with `TestInfo` from
    `@azure-tools/test-recorder`
  - Replace `new Recorder(context.currentTest)` with `new Recorder(context)`
  - Replace `beforeEach(async function (this: Context)` with
    `beforeEach(async (ctx) =>`
- Fix missing `/` separator in resolve-pnpm-lock-merge-conflict.md shell
  command: `git add `git rev-parse --show-toplevel`pnpm-lock.yaml` ->
  `git add `git rev-parse --show-toplevel`/pnpm-lock.yaml`
- Remove incorrect `npm install -g common/tools/dev-tool` command from
  steps-after-generations.md; `npx dev-tool` is sufficient

Co-authored-by: ...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes Azure/azure-sdk-for-js#37387

<!-- START COPILOT CODING AGENT TIPS -->
---

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. [Learn more about Advanced Security.](https://gh.io/cca-advanced-security)

Co-authored-by: timovv <1787642+timovv@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix documentation inconsistencies in documentation folder docs: Fix documentation inconsistencies in documentation/ folder Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants