Remove require("os") from helpers to reduce dependencies for browser scenarios.

This commit is contained in:
David Anson 2021-12-27 03:41:43 +00:00 committed by GitHub
parent 9ec14f13a1
commit fd24b9552b
4 changed files with 20 additions and 20 deletions

View file

@ -387,7 +387,7 @@ test("forEachInlineCodeSpan", (t) => {
});
test("getPreferredLineEnding", (t) => {
t.plan(17);
t.plan(19);
const testCases = [
[ "", os.EOL ],
[ "\r", "\r" ],
@ -412,6 +412,16 @@ test("getPreferredLineEnding", (t) => {
const actual = helpers.getPreferredLineEnding(input);
t.is(actual, expected, "Incorrect line ending returned.");
});
t.is(
helpers.getPreferredLineEnding("", "linux"),
"\n",
"Incorrect line ending for linux"
);
t.is(
helpers.getPreferredLineEnding("", "win32"),
"\r\n",
"Incorrect line ending for win32"
);
});
test("applyFix", (t) => {