diff --git a/Gruntfile.js b/Gruntfile.js index 18f20ea..36b4903 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -62,6 +62,13 @@ module.exports = function(grunt) { vendor: 'http://code.jquery.com/jquery-1.10.1.min.js' } }, +// @todo: automate fail case here +// syntaxError: { +// src: 'test/fixtures/syntaxError/src/**/*.js', +// options: { +// specs: 'test/fixtures/syntaxError/spec/**/*.js' +// } +// }, customTemplate: { src: 'test/fixtures/pivotal/src/**/*.js', options: { diff --git a/tasks/jasmine.js b/tasks/jasmine.js index bd23731..fa755fd 100644 --- a/tasks/jasmine.js +++ b/tasks/jasmine.js @@ -140,7 +140,8 @@ module.exports = function(grunt) { grunt.log.error(message.red); }); } else { - grunt.log.error(string.red); + grunt.log.error("Error caught from phantom. More info can be found by opening the Spec Runner in a browser."); + grunt.warn(string); } }); diff --git a/test/fixtures/syntaxError/spec/test-spec.js b/test/fixtures/syntaxError/spec/test-spec.js new file mode 100644 index 0000000..feccc43 --- /dev/null +++ b/test/fixtures/syntaxError/spec/test-spec.js @@ -0,0 +1,7 @@ +describe("syntax error test specs", function() { + + it("specs should pass but task should fail", function() { + expect(true).toBeTruthy(); + }); + +}); diff --git a/test/fixtures/syntaxError/src/test.js b/test/fixtures/syntaxError/src/test.js new file mode 100644 index 0000000..f76cd1c --- /dev/null +++ b/test/fixtures/syntaxError/src/test.js @@ -0,0 +1,7 @@ + + +// arbitrary broken JavaScriptt + +arostien:*&SRT)(*LIRSETN:R*ST&)(R*ST&J(*RSTL)); + +window.foo = true;