Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

Added simple --grep test

Tj Holowaychuk32ddb5657dd6
diff --git a/Makefile b/Makefile
index 3c5267af..f5cceb9e 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@ REPORTER = list
test: test-unit
-test-all: test-bdd test-tdd test-exports test-unit
+test-all: test-bdd test-tdd test-exports test-unit test-grep
test-unit:
@./bin/mocha \
@@ -18,20 +18,26 @@ test-bdd:
--require should \
--reporter $(REPORTER) \
--ui bdd \
- test/bdd.js
+ test/bdd
test-tdd:
@./bin/mocha \
--require should \
--reporter $(REPORTER) \
--ui tdd \
- test/tdd.js
+ test/tdd
test-exports:
@./bin/mocha \
--require should \
--reporter $(REPORTER) \
--ui exports \
- test/exports.js
+ test/exports
-.PHONY: test test-all test-bdd test-tdd test-exports test-unit
\ No newline at end of file
+test-grep:
+ @./bin/mocha \
+ --reporter $(REPORTER) \
+ --grep fast \
+ test/grep
+
+.PHONY: test test-all test-bdd test-tdd test-exports test-unit test-grep
\ No newline at end of file
diff --git a/test/grep.js b/test/grep.js
new file mode 100644
index 00000000..d40effb1
--- /dev/null
+++ b/test/grep.js
@@ -0,0 +1,22 @@
+
+describe('grep', function(){
+ describe('fast', function(){
+ it('should run fast', function(){
+
+ })
+
+ it('should run fast again', function(){
+
+ })
+ })
+
+ describe('slow', function(){
+ it('should run slow', function(done){
+ setTimeout(done, 1000);
+ })
+
+ it('should run slow again', function(done){
+ setTimeout(done, 1000);
+ })
+ })
+})