forked from prettier/prettier
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also infer parser when using
--list-different
(prettier#1997)
* Also infer parser when using `--list-different` * Add integration tests for parser inference
- Loading branch information
1 parent
df7311a
commit d679f23
Showing
5 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
tests_integration/__tests__/__snapshots__/with-parser-inference.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`infers postcss parser 1`] = ` | ||
"/* JavaScript */ | ||
\\"use strict\\"; | ||
/* Stylesheet */ | ||
* { | ||
outline: none; | ||
} | ||
" | ||
`; | ||
|
||
exports[`infers postcss parser with --list-different 1`] = `""`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
"use strict"; | ||
|
||
const runPrettier = require("../runPrettier"); | ||
|
||
test("infers postcss parser", () => { | ||
const result = runPrettier("cli/with-parser-inference", ["*"]); | ||
|
||
expect(result.stdout).toMatchSnapshot(); | ||
}); | ||
|
||
test("infers postcss parser with --list-different", () => { | ||
const result = runPrettier("cli/with-parser-inference", [ | ||
"--list-different", | ||
"*" | ||
]); | ||
|
||
expect(result.stdout).toMatchSnapshot(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/* JavaScript */ | ||
"use strict"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* Stylesheet */ | ||
* { | ||
outline: none; | ||
} |