diff --git a/.gitignore b/.gitignore index 9e36893b1e..1587af4a9d 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ output *~ \#* \.#* +output diff --git a/lib/runner/filematcher.js b/lib/runner/filematcher.js index 6f717768bd..b7d1f09706 100644 --- a/lib/runner/filematcher.js +++ b/lib/runner/filematcher.js @@ -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); }, diff --git a/test/mock-errors/sample-error.js b/test/mock-errors/sample-error.js new file mode 100644 index 0000000000..19ee12b8d5 --- /dev/null +++ b/test/mock-errors/sample-error.js @@ -0,0 +1 @@ +throw new Error('An error in a user file'); diff --git a/test/src/runner/testFileMatcher.js b/test/src/runner/testFileMatcher.js index 807f3edc04..4cf2de6d09 100644 --- a/test/src/runner/testFileMatcher.js +++ b/test/src/runner/testFileMatcher.js @@ -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 = {