Skip to content

Commit bfbc580

Browse files
committed
Undo alphabetic sorting of third-party scripts
1 parent 3429b8a commit bfbc580

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

src/common/third-party.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"use strict";
22

3+
const getStream = require("get-stream");
34
const cosmiconfig = require("cosmiconfig");
45
const findParentDir = require("find-parent-dir").sync;
5-
const getStream = require("get-stream");
66

77
module.exports = {
8+
getStream,
89
cosmiconfig,
9-
findParentDir,
10-
getStream
10+
findParentDir
1111
};

tests_integration/runPrettier.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ function runPrettier(dir, args, options) {
7171
// We cannot use `jest.setMock("get-stream", impl)` here, because in the
7272
// production build everything is bundled into one file so there is no
7373
// "get-stream" module to mock.
74+
jest.spyOn(require(thirdParty), "getStream").mockImplementation(() => ({
75+
then: handler => handler(options.input || "")
76+
}));
7477
jest
7578
.spyOn(require(thirdParty), "cosmiconfig")
7679
.mockImplementation((moduleName, options) =>
@@ -79,15 +82,10 @@ function runPrettier(dir, args, options) {
7982
Object.assign({}, options, { stopDir: __dirname })
8083
)
8184
);
82-
8385
jest
8486
.spyOn(require(thirdParty), "findParentDir")
8587
.mockImplementation(() => process.cwd());
8688

87-
jest.spyOn(require(thirdParty), "getStream").mockImplementation(() => ({
88-
then: handler => handler(options.input || "")
89-
}));
90-
9189
try {
9290
require(prettierCli);
9391
status = (status === undefined ? process.exitCode : status) || 0;

0 commit comments

Comments
 (0)