From ea5bfb44e4faa52d9ad0b7ccf992a185de851d8d Mon Sep 17 00:00:00 2001 From: TheDancingCode Date: Mon, 22 Jan 2018 19:20:50 +0100 Subject: [PATCH] Fix tests on windows (#3785) --- tests_integration/__tests__/plugin-extensions.js | 3 ++- tests_integration/__tests__/plugin-preprocess.js | 3 ++- tests_integration/__tests__/plugin-resolution.js | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests_integration/__tests__/plugin-extensions.js b/tests_integration/__tests__/plugin-extensions.js index df39fcb45..aaf934b9c 100644 --- a/tests_integration/__tests__/plugin-extensions.js +++ b/tests_integration/__tests__/plugin-extensions.js @@ -1,10 +1,11 @@ "use strict"; const runPrettier = require("../runPrettier"); +const EOL = require("os").EOL; describe("uses 'extensions' from languages to determine parser", () => { runPrettier("plugins/extensions", ["*.foo", "--plugin=./plugin"]).test({ - stdout: "!contents\n", + stdout: "!contents" + EOL, stderr: "", status: 0, write: [] diff --git a/tests_integration/__tests__/plugin-preprocess.js b/tests_integration/__tests__/plugin-preprocess.js index a2efd02d4..7b2ab7709 100644 --- a/tests_integration/__tests__/plugin-preprocess.js +++ b/tests_integration/__tests__/plugin-preprocess.js @@ -1,10 +1,11 @@ "use strict"; const runPrettier = require("../runPrettier"); +const EOL = require("os").EOL; describe("parser preprocess function is used to reshape input text", () => { runPrettier("plugins/preprocess", ["*.foo", "--plugin=./plugin"]).test({ - stdout: "preprocessed:contents\n", + stdout: "preprocessed:contents" + EOL, stderr: "", status: 0, write: [] diff --git a/tests_integration/__tests__/plugin-resolution.js b/tests_integration/__tests__/plugin-resolution.js index 2358f6511..8ee67a230 100644 --- a/tests_integration/__tests__/plugin-resolution.js +++ b/tests_integration/__tests__/plugin-resolution.js @@ -1,10 +1,11 @@ "use strict"; const runPrettier = require("../runPrettier"); +const EOL = require("os").EOL; describe("automatically loads 'prettier-plugin-*' from package.json devDependencies", () => { runPrettier("plugins/automatic", ["file.txt", "--parser=foo"]).test({ - stdout: "foo+contents\n", + stdout: "foo+contents" + EOL, stderr: "", status: 0, write: [] @@ -13,7 +14,7 @@ describe("automatically loads 'prettier-plugin-*' from package.json devDependenc describe("automatically loads '@prettier/plugin-*' from package.json dependencies", () => { runPrettier("plugins/automatic", ["file.txt", "--parser=bar"]).test({ - stdout: "bar+contents\n", + stdout: "bar+contents" + EOL, stderr: "", status: 0, write: []