From e157b822bf1f47fb274b9f5fbb85c2848598c65e Mon Sep 17 00:00:00 2001 From: Jarrod Overson Date: Sat, 15 Jun 2013 12:08:34 -0700 Subject: [PATCH] failing task on unspecified phantom error, closes #64 --- Gruntfile.js | 7 +++++++ tasks/jasmine.js | 3 ++- test/fixtures/syntaxError/spec/test-spec.js | 7 +++++++ test/fixtures/syntaxError/src/test.js | 7 +++++++ 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/syntaxError/spec/test-spec.js create mode 100644 test/fixtures/syntaxError/src/test.js 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;