Skip to content

armgit / mocha

Public Imported from GitHub
0

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

[reporter] Add test for pending tests of json-reporter

Quanlong He6067cfe6125b
diff --git a/test/reporters/json.js b/test/reporters/json.js
index e5c1a0a2..56173bf3 100644
--- a/test/reporters/json.js
+++ b/test/reporters/json.js
@@ -40,4 +40,23 @@ describe('json reporter', function(){
});
})
+ it('should have 1 test pending', function(done) {
+ var testTitle = 'json test 1';
+
+ suite.addTest(new Test(testTitle));
+
+ runner.run(function(failureCount) {
+ failureCount.should.be.exactly(0);
+ runner.should.have.property('testResults');
+ runner.testResults.should.have.property('pending');
+ runner.testResults.pending.should.be.an.instanceOf(Array);
+ runner.testResults.pending.should.have.a.lengthOf(1);
+
+ var pending = runner.testResults.pending[0];
+ pending.should.have.property('title', testTitle);
+
+ done();
+ });
+ })
+
})