+
Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

test(rome_formatter_test): JSON Prettier Tests #2568 #3913

Merged
merged 6 commits into from
Dec 2, 2022

Conversation

denbezrukov
Copy link
Contributor

@denbezrukov denbezrukov commented Dec 1, 2022

Summary

Initial PR which implements testing for rome_json_formatter:

  1. Reuse check_reformat logic.
  2. Reuse prettier_tests logic.

TODO:

  1. Reuse spec_test logic.
  2. Reuse prepare_test logic.
  3. Clean crates dependencies.

Open questions:
Do we need to merge prettier compatibility reports from js and json crates?

Test Plan

cargo test -p rome_js_formatter && cargo test -p rome_json_formatter

@netlify
Copy link

netlify bot commented Dec 1, 2022

Deploy Preview for docs-rometools canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit 03b694c
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/638a141128d6e60008c95758

Copy link
Contributor

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

Awesome work. I've one proposal how it may be possible to reduce some of the traits (but you'll know better if it's a good idea) and left a few questions.

@MichaReiser MichaReiser changed the title feat(rome_formatter_test): Multi-Lang Formatter: Benchmark and Testing #2568 test(rome_formatter_test): Multi-Lang Formatter: Benchmark and Testing #2568 Dec 1, 2022
@MichaReiser
Copy link
Contributor

@leops is a test crate idiomatic Rust to share test code?

@leops
Copy link
Contributor

leops commented Dec 1, 2022

is a test crate idiomatic Rust to share test code?

Well using a crate is pretty much the only way to efficiently share code, plus we already have the tests_macros crate anyway ...

@MichaReiser MichaReiser changed the title test(rome_formatter_test): Multi-Lang Formatter: Benchmark and Testing #2568 test(rome_formatter_test): JSON Prettier Tests #2568 Dec 2, 2022
@denbezrukov denbezrukov force-pushed the feat/rome_test_formatter branch from 7e20c36 to 0dcd37b Compare December 2, 2022 08:26
@denbezrukov denbezrukov force-pushed the feat/rome_test_formatter branch from 0dcd37b to 7453528 Compare December 2, 2022 08:27
@MichaReiser MichaReiser mentioned this pull request Dec 2, 2022
6 tasks
}
}

fn is_ignored(file_name: &str) -> bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: It would be nice if the ignored are handled per language. But let's leave this for another PR

Copy link
Contributor

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

Nice work! I think we're good to go after you remove the prettier argument from the prepareTests function

@MichaReiser MichaReiser added A-Formatter Area: formatter L-JSON Language: JSON labels Dec 2, 2022
@MichaReiser MichaReiser merged commit 452aede into rome:main Dec 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Formatter Area: formatter L-JSON Language: JSON
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载