Skip to content

Commit

Permalink
tweaks [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Stockman committed May 18, 2017
1 parent 22bad8b commit 03eb4e9
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions src/commands/ExecCommand.js
@@ -1,7 +1,6 @@
import async from "async";

import ChildProcessUtilities from "../ChildProcessUtilities";

import Command from "../Command";
import PackageUtilities from "../PackageUtilities";
import UpdatedPackagesCollector from "../UpdatedPackagesCollector";
Expand All @@ -16,8 +15,9 @@ export const describe = "Run an arbitrary command in each package.";

export const builder = {
"only-updated": {
"describe": "When executing scripts/commands, only run the script/command on packages which "
+ "have been updated since the last release"
group: "Command Options:",
describe: "Run command in packages that have been updated since the last release only",
type: "boolean",
},
"parallel": {
group: "Command Options:",
Expand Down
5 changes: 3 additions & 2 deletions src/commands/RunCommand.js
Expand Up @@ -21,8 +21,9 @@ export const builder = {
type: "boolean",
},
"only-updated": {
"describe": "When executing scripts/commands, only run the script/command on packages which "
+ "have been updated since the last release"
group: "Command Options:",
describe: "Run script in packages that have been updated since the last release only",
type: "boolean",
},
"parallel": {
group: "Command Options:",
Expand Down
13 changes: 7 additions & 6 deletions test/ExecCommand.js
Expand Up @@ -112,12 +112,13 @@ describe("ExecCommand", () => {
}));
});

it("should filter packages that are not updated when onlyUpdate", (done) => {

UpdatedPackagesCollector.prototype.getUpdates = jest.fn(() => [{ package: {
name: "package-2",
location: path.join(testDir, "packages/package-2")
} }]);
it("should filter packages that are not updated with --only-updated", (done) => {
UpdatedPackagesCollector.prototype.getUpdates = jest.fn(() => [{
package: {
name: "package-2",
location: path.join(testDir, "packages/package-2"),
},
}]);

const execCommand = new ExecCommand(["ls"], {
onlyUpdated: true,
Expand Down
4 changes: 1 addition & 3 deletions test/PackageUtilities.js
Expand Up @@ -183,12 +183,11 @@ describe("PackageUtilities", () => {
});

describe(".filterPackagesThatAreNotUpdated()", () => {

it("should return an empty array when there are no packages to filter", () => {
const packagesToFilter = [];
const packageUpdates = [
{ package: { name: "ghi" } },
{ package: { name: "xyz" } }
{ package: { name: "xyz" } },
];
const updatedPackages = PackageUtilities.filterPackagesThatAreNotUpdated(
packagesToFilter,
Expand Down Expand Up @@ -230,7 +229,6 @@ describe("PackageUtilities", () => {
expect(updatedPackages).toHaveLength(1);
expect(updatedPackages).toEqual([{ name: "ghi" }]);
});

});

describe(".topologicallyBatchPackages()", () => {
Expand Down
16 changes: 8 additions & 8 deletions test/RunCommand.js
Expand Up @@ -149,12 +149,14 @@ describe("RunCommand", () => {
});
});

it("should filter packages that are not updated when onlyUpdate", (done) => {
UpdatedPackagesCollector.prototype.getUpdates = jest.fn(() => [{ package: {
name: "package-3",
location: path.join(testDir, "packages/package-3"),
scripts: { "my-script": "echo package-3" }
} }]);
it("should filter packages that are not updated with --only-updated", (done) => {
UpdatedPackagesCollector.prototype.getUpdates = jest.fn(() => [{
package: {
name: "package-3",
location: path.join(testDir, "packages/package-3"),
scripts: { "my-script": "echo package-3" },
},
}]);

const runCommand = new RunCommand(["my-script"], {
onlyUpdated: true,
Expand Down Expand Up @@ -198,7 +200,6 @@ describe("RunCommand", () => {
}
}));
});

});

describe("with --include-filtered-dependencies", () => {
Expand Down Expand Up @@ -231,5 +232,4 @@ describe("RunCommand", () => {
}));
});
});

});

0 comments on commit 03eb4e9

Please sign in to comment.