test: add test cases for AST node expansion and interactions#398
test: add test cases for AST node expansion and interactions#398lumirlumir wants to merge 21 commits into
Conversation
✅ Deploy Preview for eslint-code-explorer ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Pull request overview
Adds end-to-end Playwright tests for AST node expansion across multiple language parser options (JavaScript, JSON, Markdown, CSS, HTML), structured into test.describe blocks for clarity.
Changes:
- Adds an
AST node expansiondescribe block covering JavaScript source types, ECMAScript version, and JSX. - Adds JSON tests for JSON/JSONC/JSON5 modes and
Allow Trailing Commasoption. - Adds Markdown (CommonMark/GFM, frontmatter variants, math), CSS (tolerant parsing), and HTML (template engine syntax, front matter) tests.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Two optional suggestions:
|
|
Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update. |
Sounds good to me. I took the smaller approach and added
I initially tried using the JSON displayed in CodeMirror, but it made the tests more brittle. CodeMirror only renders the current viewport and a small margin to the DOM, so reading the complete JSON would require repeatedly scrolling and combining the rendered content. This makes the tests more complex and unstable, so I’d prefer to retain the current approach. |
|
|
||
| test("Mode: CommonMark", async ({ page }) => { | ||
| // `Mode`: `CommonMark` | ||
| await setComboboxOption(page, "Mode", "CommonMark"); |
There was a problem hiding this comment.
Setting options may should be abstracted more by introducing an additional helper setOptions which abstracts setting the options and pressing Escape after:
await setOptions(page, [
{ role: 'combobox', name: 'Mode', value: 'CommonMark' },
{ role: 'combobox', name: 'Front Matter', value: 'Off' },
{ role: 'switch', name: 'Math', value: false },
])|
When I suggested using the JSON, I tried a naive |
@DMartens Can you clarify your suggestion with correctly working e2e test examples? Accessing |
Prerequisites checklist
AI acknowledgment
What is the purpose of this pull request?
This PR adds AST node expansion tests for various parser options, such as Markdown frontmatter and math, as well as the JSON
allowTrailingCommasoption.Since these end-to-end test cases cover the full range of AST interactions across different languages, the amount of code added is a bit large. However, that was the original purpose of #64 (comment), so I think it’s worth adding.
What changes did you make? (Give an overview)
Added test cases for:
Also, I’ve divided the section using
test.describeto make it clearer how the tests are partitioned and structured.Related Issues
N/A
Is there anything you'd like reviewers to focus on?
N/A