Skip to content

test: use tree-sitter test fixtures#3

Open
HenriqueLimas wants to merge 1 commit into
marko-js:mainfrom
HenriqueLimas:tree-sitter-test
Open

test: use tree-sitter test fixtures#3
HenriqueLimas wants to merge 1 commit into
marko-js:mainfrom
HenriqueLimas:tree-sitter-test

Conversation

@HenriqueLimas

Copy link
Copy Markdown

No description provided.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

Wait, I see I have duplicates and missed some ranges. Let me recount and ensure each range appears exactly once.

I realize I still have duplicates and missing ranges. Let me count all ranges carefully and produce the final clean output.

Walkthrough

The PR removes the Mocha-based test infrastructure (five files: fixtures.test.mts, compare.mts, events.mts, htmljs.mts, and tree-events.mts, totalling ~1,180 deleted lines) and replaces it with the tree-sitter test runner. In package.json, the mocha and @types/mocha devDependencies are removed, and the test script is changed from a Mocha command to tree-sitter test. Alongside this, approximately 60 new corpus fixture files are added under test/corpus/, each defining named input snippets and their expected S-expression parse-tree outputs. The fixtures cover the full grammar surface: basic tags, attributes, shorthand class/id, concise mode, placeholders, script/scriptlet content, HTML/XML/CSS/TypeScript constructs, whitespace, multiline blocks, error recovery, and EOF edge cases.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No description was provided by the author, making it impossible to evaluate relevance to the changeset. Add a description explaining the purpose of migrating from Mocha tests to tree-sitter test fixtures.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: replacing Mocha-based tests with tree-sitter test fixtures throughout the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test/corpus/concise_comment_fixtures.txt (1)

1-64: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Standardize fixture naming pattern in concise_comment_fixtures.txt and concise_script_fixtures.txt to match peer files.

Both files deviate from the consistent "Fixture (htmljs target)" header format used throughout the rest of the corpus suite. The inconsistency affects maintainability and clarity.

  • test/corpus/concise_comment_fixtures.txt#L1-L64: Replace all three fixture headers with the standard "Fixture (htmljs target)" format (lines 2, 22, and 43 headers).
  • test/corpus/concise_script_fixtures.txt#L1-L62: Replace both fixture headers with the standard format (lines 2 and 34 headers).

For example:

  • Line 2 should read: Fixture concise-line-comment-before-fence-text (htmljs target)
  • Line 22 should read: Fixture concise-block-comment-trailing-text-invalid (htmljs target)
  • Line 43 should read: Fixture concise-block-comment-before-fence-text (htmljs target)

And in concise_script_fixtures.txt:

  • Line 2 should read: Fixture script-concise-fenced-body-and-line-continuation (htmljs target)
  • Line 34 should read: Fixture script-concise-forms-and-script-src-attr (htmljs target)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/corpus/concise_comment_fixtures.txt` around lines 1 - 64, Standardize
the fixture header naming pattern across both test corpus files to match the
consistent "Fixture <descriptive-name> (htmljs target)" format used in peer
files. In test/corpus/concise_comment_fixtures.txt (lines 1-64), replace the
three fixture headers at lines 2, 22, and 43 with "Fixture
concise-line-comment-before-fence-text (htmljs target)", "Fixture
concise-block-comment-trailing-text-invalid (htmljs target)", and "Fixture
concise-block-comment-before-fence-text (htmljs target)" respectively. In
test/corpus/concise_script_fixtures.txt (lines 1-62), replace the two fixture
headers at lines 2 and 34 with "Fixture
script-concise-fenced-body-and-line-continuation (htmljs target)" and "Fixture
script-concise-forms-and-script-src-attr (htmljs target)" respectively.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@test/corpus/concise_comment_fixtures.txt`:
- Around line 1-64: Standardize the fixture header naming pattern across both
test corpus files to match the consistent "Fixture <descriptive-name> (htmljs
target)" format used in peer files. In test/corpus/concise_comment_fixtures.txt
(lines 1-64), replace the three fixture headers at lines 2, 22, and 43 with
"Fixture concise-line-comment-before-fence-text (htmljs target)", "Fixture
concise-block-comment-trailing-text-invalid (htmljs target)", and "Fixture
concise-block-comment-before-fence-text (htmljs target)" respectively. In
test/corpus/concise_script_fixtures.txt (lines 1-62), replace the two fixture
headers at lines 2 and 34 with "Fixture
script-concise-fenced-body-and-line-continuation (htmljs target)" and "Fixture
script-concise-forms-and-script-src-attr (htmljs target)" respectively.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0d7cc8c4-5075-4148-a229-0e497eea9695

📥 Commits

Reviewing files that changed from the base of the PR and between 1389646 and ac5775f.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json and included by **
📒 Files selected for processing (83)
  • __tests__/fixtures.test.mts
  • __tests__/util/compare.mts
  • __tests__/util/events.mts
  • __tests__/util/htmljs.mts
  • __tests__/util/tree-events.mts
  • package.json
  • test/corpus/argument_tag_fixtures.txt
  • test/corpus/attr_fixtures.txt
  • test/corpus/attribute_error_fixtures.txt
  • test/corpus/attribute_expressions.txt
  • test/corpus/attribute_group_fixtures.txt
  • test/corpus/attribute_methods.txt
  • test/corpus/attribute_spread_fixtures.txt
  • test/corpus/attribute_value_fixtures.txt
  • test/corpus/backtick_fixtures.txt
  • test/corpus/bad_fixtures.txt
  • test/corpus/cdata_and_doctype_fixtures.txt
  • test/corpus/coma_fixtures.txt
  • test/corpus/comma_attribute_fixtures.txt
  • test/corpus/comma_fixtures.txt
  • test/corpus/commas_fixtures.txt
  • test/corpus/comments_and_edges.txt
  • test/corpus/comments_fixtures.txt
  • test/corpus/complex_fixtures.txt
  • test/corpus/concise_comment_fixtures.txt
  • test/corpus/concise_fixtures.txt
  • test/corpus/concise_mode.txt
  • test/corpus/concise_script_fixtures.txt
  • test/corpus/core_syntax_regressions.txt
  • test/corpus/css_fixtures.txt
  • test/corpus/default_fixtures.txt
  • test/corpus/double_hyphen_fixtures.txt
  • test/corpus/dtd_fixtures.txt
  • test/corpus/empty_fixtures.txt
  • test/corpus/eof_fixtures.txt
  • test/corpus/eof_open_tag_fixtures.txt
  • test/corpus/html_fixtures.txt
  • test/corpus/html_mode.txt
  • test/corpus/ignoreNonstandardStringPlaceholders_fixtures.txt
  • test/corpus/ignorePlaceholders_fixtures.txt
  • test/corpus/invalid_fixtures.txt
  • test/corpus/marko6_forms.txt
  • test/corpus/marko_tags.txt
  • test/corpus/mixed_fixtures.txt
  • test/corpus/multi_fixtures.txt
  • test/corpus/multiline_fixtures.txt
  • test/corpus/multiple_fixtures.txt
  • test/corpus/nested_fixtures.txt
  • test/corpus/open_fixtures.txt
  • test/corpus/open_tag_comment_fixtures.txt
  • test/corpus/param_fixtures.txt
  • test/corpus/parsed_fixtures.txt
  • test/corpus/pending_regressions.txt
  • test/corpus/placeholder_edge_fixtures.txt
  • test/corpus/placeholder_eof_fixtures.txt
  • test/corpus/placeholder_fixtures.txt
  • test/corpus/raw_text_edge_fixtures.txt
  • test/corpus/root_fixtures.txt
  • test/corpus/script_fixtures.txt
  • test/corpus/scriptlet_fixtures.txt
  • test/corpus/self_fixtures.txt
  • test/corpus/semicolon_fixtures.txt
  • test/corpus/shorthand_fixtures.txt
  • test/corpus/shorthand_id_class_fixtures.txt
  • test/corpus/simple_fixtures.txt
  • test/corpus/single_fixtures.txt
  • test/corpus/statement_fixtures.txt
  • test/corpus/stray_fixtures.txt
  • test/corpus/strip_fixtures.txt
  • test/corpus/tag_default_value_fixtures.txt
  • test/corpus/tag_fixtures.txt
  • test/corpus/text_fixtures.txt
  • test/corpus/textarea_fixtures.txt
  • test/corpus/top_level.txt
  • test/corpus/ts_fixtures.txt
  • test/corpus/unary_fixtures.txt
  • test/corpus/unclosed_fixtures.txt
  • test/corpus/var_fixtures.txt
  • test/corpus/void_fixtures.txt
  • test/corpus/void_tag_fixtures.txt
  • test/corpus/whitespace_fixtures.txt
  • test/corpus/xml_declaration_fixtures.txt
  • test/corpus/xml_fixtures.txt
💤 Files with no reviewable changes (5)
  • tests/util/compare.mts
  • tests/util/events.mts
  • tests/fixtures.test.mts
  • tests/util/htmljs.mts
  • tests/util/tree-events.mts

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.

1 participant