Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added reporter test example

  • Loading branch information...
commit 1f482a6989dd51811cd08cbf80136ebc6a7ef60c 1 parent a9616f4
@tj tj authored
View
5 Makefile
@@ -27,7 +27,10 @@ test-all: test-bdd test-tdd test-qunit test-exports test-unit test-grep
test-unit:
@./bin/mocha \
- --reporter $(REPORTER)
+ --reporter $(REPORTER) \
+ test/*.js \
+ test/acceptance/*.js \
+ test/acceptance/reporters/*.js
test-bdd:
@./bin/mocha \
View
20 test/acceptance/reporters/dot.js
@@ -0,0 +1,20 @@
+
+var exec = require('child_process').exec;
+
+function mocha(fn) {
+ var args = [].slice.call(arguments);
+ var fn = args.pop();
+ exec('bin/mocha ' + args.join(' '), fn);
+}
+
+describe('dot reporter', function(){
+ describe('when passing', function(){
+ it('should output dots', function(done){
+ mocha('test/acceptance/reporters/fixtures/pass.js', function(err, stdout, stderr){
+ if (err) return done(err);
+ console.log(stdout);
+ done();
+ });
+ })
+ })
+})
View
18 test/acceptance/reporters/fixtures/pass.js
@@ -0,0 +1,18 @@
+
+describe('foo', function(){
+ it('should work', function(){
+
+ })
+})
+
+describe('bar', function(){
+ it('should work', function(){
+
+ })
+})
+
+describe('baz', function(){
+ it('should work', function(){
+
+ })
+})
View
2  test/mocha.opts
@@ -3,4 +3,4 @@
--ui bdd
--growl
--globals okGlobalA,okGlobalB
---timeout 200
+--timeout 1s
Please sign in to comment.
Something went wrong with that request. Please try again.