Skip to content

Commit

Permalink
Add coverage summary functional test.
Browse files Browse the repository at this point in the history
  • Loading branch information
reid committed Feb 12, 2014
1 parent cd1bc97 commit e1be8be
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions test/functional/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ vows.describe("Yeti CLI").addBatch({
topic.fe.route([
"node",
"cli.js",
"--coverage",
"-p", port,
__dirname + "/fixture/query-string.html",
]);
Expand Down Expand Up @@ -277,21 +278,31 @@ vows.describe("Yeti CLI").addBatch({
cli: cli
});

cli.config.stderr.captureData();

cli.config.stdin.write("\n"); // Enter
},
"is ok": function (topic) {
assert.isUndefined(topic.stack);
},
"the stderr output contains the failing test details": function (topic) {
"the stdout output contains the failing test details": function (topic) {
assert.include(topic.output, "testMoof");
assert.include(topic.output, "Values should be equal.");
assert.include(topic.output, "Expected: moof (string)");
assert.include(topic.output, "Actual: ? (string)");
assert.include(topic.output, "1 of 1 tests failed");
},
"the stderr output contains Agent complete": function (topic) {
"the stdout output contains Agent complete": function (topic) {
assert.include(topic.output, "Agent complete");
},
"the stderr output contains coverage summary": function (topic) {
var capture = topic.cli.config.stderr.capturedData;
assert.include(capture, "Coverage summary");
assert.include(capture, "Statements");
assert.include(capture, "Branches");
assert.include(capture, "Functions");
assert.include(capture, "Lines");
},
"should exit": {
topic: function (topic) {
var vow = this;
Expand Down

0 comments on commit e1be8be

Please sign in to comment.