Skip to content

Commit

Permalink
Merge branch 'error-silent' of git://github.com/soundstep/nightwatch …
Browse files Browse the repository at this point in the history
…into releases/v0.9
  • Loading branch information
beatfactor committed Nov 25, 2016
2 parents 4a8f2ec + 87d4bed commit 20357db
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ output
*~
\#*
\.#*
output
10 changes: 1 addition & 9 deletions lib/runner/filematcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,7 @@ module.exports = {
* @returns {boolean} true if specified test matches given tag
*/
match : function (testFilePath, opts) {
var test;

try {
test = require(testFilePath);
} catch (e) {
// could not load test module
return false;
}

var test = require(testFilePath);
return this.checkModuleTags(test, opts);
},

Expand Down
1 change: 1 addition & 0 deletions test/mock-errors/sample-error.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
throw new Error('An error in a user file');
14 changes: 14 additions & 0 deletions test/src/runner/testFileMatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,20 @@ module.exports = {
assert.ok(matched === true);
},

'tag: test loading modules containing an error should not be silent': function () {
var hasResolved = false;
try {
var tags = ['home', 'login', 'sign-up'];
var matched = FileMatcher.tags.match(path.join(__dirname, '../../mock-errors/sample-error.js'), {
tag_filter: tags
});
hasResolved = true;
} catch(err) {
assert.ok(err instanceof Error);
}
assert.ok(!hasResolved, 'should not have resolved');
},

'tag: test matching numeric tags': function () {
var tags = ['room', 101];
var testModule = {
Expand Down

0 comments on commit 20357db

Please sign in to comment.