Skip to content

Commit a551fa0

Browse files
committed
[INTERNAL] Add basic CLI test
1 parent 0c533fe commit a551fa0

File tree

3 files changed

+141
-42
lines changed

3 files changed

+141
-42
lines changed

package-lock.json

Lines changed: 124 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
"docdash": "^1.0.0",
116116
"eslint": "^5.0.1",
117117
"eslint-config-google": "^0.10.0",
118+
"execa": "^1.0.0",
118119
"jsdoc": "^3.5.5",
119120
"nyc": "^13.0.1",
120121
"opn-cli": "^3.1.0",

test/lib/cli/commands/base.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const {test} = require("ava");
2+
const path = require("path");
3+
const execa = require("execa");
4+
const pkg = require("../../../../package.json");
5+
const ui5Cli = path.join(__dirname, "..", "..", "..", "..", "bin", "ui5.js");
6+
const ui5 = (args, options = {}) => execa(ui5Cli, args, options);
7+
8+
test("ui5 --version", async (t) => {
9+
const {stdout} = await ui5(["--version"]);
10+
t.is(stdout, pkg.version);
11+
});
12+
13+
test("ui5 -v", async (t) => {
14+
const {stdout} = await ui5(["-v"]);
15+
t.is(stdout, pkg.version);
16+
});

0 commit comments

Comments
 (0)