Files
test-repo/tests/format/misc/empty/format.test.js
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
890 B
JavaScript
Raw Normal View History

import prettier from "../../../config/prettier-entry.js";
2022-01-04 17:00:25 +08:00
2022-05-06 09:27:54 +08:00
const parsers = (await prettier.getSupportInfo()).options
.find((option) => option.name === "parser")
2020-05-04 18:27:15 +08:00
.choices.filter((choice) => !choice.deprecated)
.map((choice) => choice.value);
runFormatTest(
2020-05-04 18:27:15 +08:00
{
2022-01-04 17:00:25 +08:00
importMeta: import.meta,
2020-05-04 18:27:15 +08:00
snippets: [
// empty
"",
// space
" ",
" ".repeat(5),
2020-05-04 18:27:15 +08:00
// `\n`
"\n",
" \n",
" \n ",
"\n".repeat(4),
2020-05-04 18:27:15 +08:00
" \n \n \n\n",
" \n \n \n\n ",
// `\r`
"\r",
" \r",
" \r ",
"\r".repeat(4),
2020-05-04 18:27:15 +08:00
" \r \r \r\r",
" \r \r \r\r ",
// `\r\n`
"\r\n",
" \r\n",
" \r\n ",
"\r\n\r\n\r\n\r\n",
" \r\n \r\n \r\n\r\n",
" \r\n \r\n \r\n\r\n ",
// mixed `\r` `\r\n` '\n'
" \r \r\n \n ",
].map((code) => ({ code, output: "" })),
},
parsers,
);