Browse files

Added jshint example.

  • Loading branch information...
1 parent aa3bac0 commit d7c2c251f518272ee4565b04b4d22670d145b404 @airportyh airportyh committed Sep 20, 2012
Showing with 18 additions and 3 deletions.
  1. +3 −1 README.md
  2. +3 −0 examples/jshint/README.md
  3. +3 −0 examples/jshint/hello.js
  4. +2 −0 examples/jshint/testem.yml
  5. +4 −0 examples/jshint/tests.js
  6. +3 −2 lib/dev_mode_app.js
View
4 README.md
@@ -283,7 +283,9 @@ I've created [examples](https://github.com/airportyh/testem/tree/master/examples
* [Simple Mocha Project](https://github.com/airportyh/testem/tree/master/examples/mocha_simple)
* [Hybrid Project](https://github.com/airportyh/testem/tree/master/examples/hybrid_simple) - Mocha tests running in both the browser and Node.
* [Coffeescript Project](https://github.com/airportyh/testem/tree/master/examples/coffeescript)
-* [Browserify Project](https://github.com/airportyh/testem/tree/master/examples/browserify)
+* [Browserify Project](https://github.
+com/airportyh/testem/tree/master/examples/browserify)
+* [JSHint Example](https://github.com/airportyh/testem/tree/master/examples/jshint)
* [Custom Test Framework](https://github.com/airportyh/testem/tree/master/examples/custom_adapter)
Known Issues
View
3 examples/jshint/README.md
@@ -0,0 +1,3 @@
+Install jshint via
+
+ npm install jshint
View
3 examples/jshint/hello.js
@@ -0,0 +1,3 @@
+function hello(s){
+ return "hello world";
+}
View
2 examples/jshint/testem.yml
@@ -0,0 +1,2 @@
+framework: qunit
+before_tests: jshint *.js
View
4 examples/jshint/tests.js
@@ -0,0 +1,4 @@
+test('say hello', function(){
+ equal(hello(), 'hello world', 'should equal hello world');
+});
+
View
5 lib/dev_mode_app.js
@@ -142,12 +142,13 @@ App.prototype = {
var config = this.config
var runners = this.runners
if (config.get('before_tests')){
- exec(config.get('before_tests'), function(err){
+ exec(config.get('before_tests'), function(err, stdout, stderr){
self.disableFileWatch = false
if (err){
self.view.setErrorPopupMessage(
StyledString('Problem running before_tests hook:').foreground('red').concat(
- StyledString('\n' + err)))
+ StyledString('\n' + stdout).foreground('yellow'),
+ StyledString('\n' + stderr).foreground('red')))
return
}else{
self.view.clearErrorPopupMessage()

0 comments on commit d7c2c25

Please sign in to comment.