test(formatter): correct singleQuote test#17837
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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. |
signleQuote testsingleQuote test
There was a problem hiding this comment.
Pull request overview
This PR corrects a test for the singleQuote formatter option. The test was incorrectly labeled and configured as testing singleQuote: false when a separate test already covers the default behavior (which is false). The PR updates both the test name and configuration to test singleQuote: true instead.
Changes:
- Updated test name from "should keep quotes with
singleQuote: false" to "should keep quotes withsingleQuote: true" - Changed the
singleQuoteoption value fromfalsetotruein the test configuration
Comments suppressed due to low confidence (1)
apps/oxfmt/test/tailwindcss/tailwindcss.test.ts:1071
- The expected output snapshot appears to be incorrect for
singleQuote: true. WhensingleQuoteis set totrue, the formatter should convert double quotes to single quotes in JavaScript/JSX code (for the outer quotes, not the quotes inside Tailwind class strings). However, the expected output here is identical to the defaultsingleQuotetest on lines 1086-1090. The expected output should likely show single quotes being preferred for the outer JavaScript code where applicable.
expect(result.code).toMatchInlineSnapshot(`
"<div className={clsx('text-md before:content-["hello"]')}>Hello</div>;
<div className={clsx("text-md before:content-['hello']")}>Hello</div>;
"
`);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merge activity
|
`singleQuote` defaults to `false`, the test below already had a default `singleQuote` test, so change this test to test `singleQuote: true`
6b35ed0 to
14fe544
Compare

singleQuotedefaults tofalse, the test below already had a defaultsingleQuotetest, so change this test to testsingleQuote: true