Skip to content

Commit

Permalink
feat: add e2e flag for igx-ts framework.
Browse files Browse the repository at this point in the history
  • Loading branch information
IvayloG committed Mar 13, 2018
1 parent 168a6e7 commit 16f1be1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
17 changes: 14 additions & 3 deletions lib/commands/test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
import { ProjectConfig } from "../ProjectConfig";
import { Util } from "../Util";

const command = {
// tslint:disable:object-literal-sort-keys
command: "test",
desc: "tests the project",
builder: {},
desc: "executes project tests",
builder: {
e2e: {
describe: "Executes end-to-end tests",
type: "boolean"
}
},
async execute(argv) {
Util.exec("npm test");
const projConfig = ProjectConfig.getConfig().project;
if (argv.e2e && projConfig.framework === "angular" && projConfig.projectType === "igx-ts") {
Util.exec("npm run e2e", { stdio: "inherit" });
} else {
Util.exec("npm test", { stdio: "inherit" });
}
}
};
export default command;
14 changes: 7 additions & 7 deletions spec/acceptance/help-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { spawnSync } from "child_process";
describe("Help command", () => {

it("should list all available commands", async done => {
const child = spawnSync("node", ["bin/execute.js", "--help" ], {
const child = spawnSync("node", ["bin/execute.js", "--help"], {
encoding: "utf-8"
});
const originalHelpText: string = `Commands:
Expand All @@ -14,7 +14,7 @@ describe("Help command", () => {
generate generates custom template [aliases: g]
config gets, sets or adds a configuration property
doc [term] opens the Infragistics search for the given term
test tests the project
test executes project tests
list list all templates [aliases: l]
Options:
--version, -v Show current Ignite UI CLI version [boolean]
Expand All @@ -28,7 +28,7 @@ describe("Help command", () => {
});

it("should show help for individual commands", async done => {
const child = spawnSync("node", ["bin/execute.js", "new", "--help" ], {
const child = spawnSync("node", ["bin/execute.js", "new", "--help"], {
encoding: "utf-8"
});
const originalNewHelpText: string = `Options:
Expand All @@ -48,7 +48,7 @@ describe("Help command", () => {
});

it("should show help config sub-commands", async done => {
const child = spawnSync("node", ["bin/execute.js", "config", "--help" ], {
const child = spawnSync("node", ["bin/execute.js", "config", "--help"], {
encoding: "utf-8"
});
const originalNewHelpText: string = `Commands:
Expand All @@ -68,7 +68,7 @@ describe("Help command", () => {
done();
});
it("should show help generate sub-commands", async done => {
const child = spawnSync("node", ["bin/execute.js", "generate", "--help" ], {
const child = spawnSync("node", ["bin/execute.js", "generate", "--help"], {
encoding: "utf-8"
});
const originalNewHelpText: string = `Commands:
Expand All @@ -85,7 +85,7 @@ describe("Help command", () => {
done();
});
it("should show help generate template sub-commands", async done => {
const child = spawnSync("node", ["bin/execute.js", "g", "t", "-h" ], {
const child = spawnSync("node", ["bin/execute.js", "g", "t", "-h"], {
encoding: "utf-8"
});
const originalNewHelpText: string = `
Expand All @@ -107,7 +107,7 @@ describe("Help command", () => {
done();
});
it("should show help for list command", async done => {
const child = spawnSync("node", ["bin/execute.js", "list", "-h" ], {
const child = spawnSync("node", ["bin/execute.js", "list", "-h"], {
encoding: "utf-8"
});
const originalNewHelpText: string = `
Expand Down

0 comments on commit 16f1be1

Please sign in to comment.