It seems that if there's an error in the spec implementation Javascript itself, the Error Message and Stacktrace don't show up even if:
ฮป gauge specs
# English vowels
## Vowel counts in single word F
Failed Step: Vowels in English language are "aeiou".
Error Message:
Stacktrace:
## Vowel counts in single word ## Vowel counts in multiple word F
Failed Step: Vowels in English language are "aeiou".
Error Message:
Stacktrace:
English vowels
=====================
This is an executable specification file. This file follows markdown syntax.
Every heading in this file denotes a scenario. Every bulleted point denotes a step.
To execute this specification, run
gauge specs
* Vowels in English language are "aeiou".
Vowel counts in single word
---------------------------
tags: single word
* The word "gauge" has "3" vowels.
Vowel counts in multiple word
-----------------------------
This is the second scenario in this specification
Here's a step that takes a table
* Almost all words have vowels
|Word |Vowel Count|
|------|-----------|
|Gauge |3 |
|Mingle|2 |
|Snap |1 |
|GoCD |1 |
|Rhythm|0 |
/* globals gauge, beforeScenario */
"use strict";
var assert = require("assert");
var vowels = ["a", "e", "i", "o", "u"];
var numberOfVowels = function(word) {
var vowelArr = word.split("").filter(function(elem) {
return vowels.indexOf(elem) > -1;
});
return vowelArr.length;
};
// --------------------------
// Gauge step implementations
// --------------------------
gauge("Vowels in English language are <vowels>.", function(vowelsGiven) {
assert.equal(vowelsGiven, vowels.join(""));
javascriptErrorHere
});
gauge("The word <word> has <number> vowels.", function(word, number) {
assert.equal(number, numberOfVowels(word));
});
gauge("Almost all words have vowels <table>", function(table) {
table.rows.forEach(function(row) {
assert.equal(numberOfVowels(row.cells[0]), parseInt(row.cells[1]));
});
});
// ---------------
// Execution Hooks
// ---------------
beforeScenario(function() {
assert.equal(vowels.join(""), "aeiou");
});
beforeScenario(function() {
assert.equal(vowels[0], "a");
}, {
tags: ["single word"]
});