Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: use insta for JS parser #4386

Merged
merged 1 commit into from
Oct 26, 2024
Merged

test: use insta for JS parser #4386

merged 1 commit into from
Oct 26, 2024

Conversation

ematipico
Copy link
Member

@ematipico ematipico commented Oct 25, 2024

Summary

This PR ports the JS tests to use insta and the same logic used in other parsers and crates across the codebase. I copied all the files we had in test_data and moved them in a new folder called js_test_suite, which name is inline with the tests parser infras.

All the files that were tagged with a // SCRIPT were renamed to have a .cjs extension. All *.options.json files now use a valid biome.json file. With this, I discovered that the grit_metavariables weren't implemented for the JS parser (cc @arendjr). This is now fixed, and the file metavar.ts works as expected.

The biome_js_parser crate also had some testing utilities we aren't supposed to use anymore because they now live inside biome_test_utils. I removed them and used biome_test_utils instead.

I removed some outdated README.md files inside the codegen files. That information is already present in the biome_parser/CONTRIBUTING.md file.

I didn't remove all the comments in the source .rs files, that was too much. I think they can stay there for now, and we can remove them later.

Test Plan

The current CI should pass

@ematipico ematipico requested review from a team October 25, 2024 13:35
@ematipico ematipico changed the title tests: use insta for JS parser test: use insta for JS parser Oct 25, 2024
@github-actions github-actions bot added A-Project Area: project A-Linter Area: linter A-Parser Area: parser L-JavaScript Language: JavaScript and super languages labels Oct 25, 2024
Copy link
Contributor

Parser conformance results on

js/262

Test result main count This PR count Difference
Total 48420 48420 0
Passed 47220 47220 0
Failed 1200 1200 0
Panics 0 0 0
Coverage 97.52% 97.52% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 40 40 0
Passed 37 37 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.50% 92.50% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 6580 6580 0
Passed 2205 2205 0
Failed 4375 4375 0
Panics 0 0 0
Coverage 33.51% 33.51% 0.00%

ts/babel

Test result main count This PR count Difference
Total 680 680 0
Passed 607 607 0
Failed 73 73 0
Panics 0 0 0
Coverage 89.26% 89.26% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 18507 18507 0
Passed 14167 14167 0
Failed 4340 4340 0
Panics 0 0 0
Coverage 76.55% 76.55% 0.00%

Copy link

codspeed-hq bot commented Oct 25, 2024

CodSpeed Performance Report

Merging #4386 will not alter performance

Comparing tests/js-parser-snapshots (113d93b) with main (28a2a6c)

Summary

✅ 101 untouched benchmarks

@ematipico ematipico force-pushed the tests/js-parser-snapshots branch from bea304a to 113d93b Compare October 25, 2024 14:19
@github-actions github-actions bot added the A-Tooling Area: internal tools label Oct 25, 2024
@ematipico ematipico merged commit 6c209ef into main Oct 26, 2024
14 checks passed
@ematipico ematipico deleted the tests/js-parser-snapshots branch October 26, 2024 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Area: linter A-Parser Area: parser A-Project Area: project A-Tooling Area: internal tools L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant