Skip to content

Comments

test(linter/plugins): add tests for new Context methods#15656

Merged
graphite-app[bot] merged 1 commit intomainfrom
11-12-test_linter_plugins_add_tests_for_new_context_methods
Nov 13, 2025
Merged

test(linter/plugins): add tests for new Context methods#15656
graphite-app[bot] merged 1 commit intomainfrom
11-12-test_linter_plugins_add_tests_for_new_context_methods

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Nov 12, 2025

Add test coverage for methods and getters on Context added in #15606 and #15632. I neglected to add tests in those PRs. Disgraceful.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI labels Nov 12, 2025
Copy link
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added the C-test Category - Testing. Code is missing test cases, or a PR is adding them label Nov 12, 2025
@overlookmotel overlookmotel marked this pull request as ready for review November 12, 2025 23:51
Copilot AI review requested due to automatic review settings November 12, 2025 23:51
@overlookmotel overlookmotel self-assigned this Nov 12, 2025
@overlookmotel overlookmotel added A-linter-plugins Area - Linter JS plugins and removed A-linter Area - Linter labels Nov 12, 2025
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Nov 12, 2025
Copy link
Member Author

overlookmotel commented Nov 12, 2025

Merge activity

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive test coverage for new Context methods (getSourceCode(), getFilename(), getPhysicalFilename(), getCwd()) and the parserOptions getter that were previously added in #15606 and #15632 but lacked test coverage.

  • Tests verify that getter methods return the same values as their property equivalents
  • Tests confirm proper error handling when methods are called in inappropriate contexts (e.g., in createOnce)
  • Snapshot files updated to reflect the additional test assertions

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
apps/oxlint/test/fixtures/sourceCode/plugin.ts Adds assertion verifying getSourceCode() returns the same reference as sourceCode property
apps/oxlint/test/fixtures/languageOptions/plugin.ts Adds assertion verifying parserOptions getter returns the same reference as languageOptions.parserOptions
apps/oxlint/test/fixtures/createOnce/plugin.ts Adds comprehensive tests for getCwd(), getFilename(), getPhysicalFilename(), getSourceCode(), and parserOptions in createOnce context, verifying expected error behavior
apps/oxlint/test/fixtures/createOnce/output.snap.md Updates snapshot to include 12 additional test outputs (6 per file) for new method/getter tests, incrementing error count from 46 to 58
apps/oxlint/test/fixtures/context_properties/plugin.ts Consolidates context property tests into single report message and adds tests for getter methods getFilename(), getPhysicalFilename(), and getCwd()
apps/oxlint/test/fixtures/context_properties/output.snap.md Updates snapshot with consolidated output format showing all context properties/methods in single report, reducing error count from 8 to 4

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Add test coverage for methods and getters on `Context` added in #15606 and #15632. I neglected to add tests in those PRs. Disgraceful.
@graphite-app graphite-app bot force-pushed the 11-12-test_linter_plugins_add_tests_for_new_context_methods branch from 3e9ddb4 to 4e844c1 Compare November 12, 2025 23:56
@github-actions github-actions bot added the A-linter Area - Linter label Nov 12, 2025
@graphite-app graphite-app bot merged commit 4e844c1 into main Nov 13, 2025
18 checks passed
@graphite-app graphite-app bot deleted the 11-12-test_linter_plugins_add_tests_for_new_context_methods branch November 13, 2025 00:01
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter A-linter-plugins Area - Linter JS plugins C-test Category - Testing. Code is missing test cases, or a PR is adding them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant