jejacks0n / teaspoon

Teaspoon: Javascript test runner for Rails. Use Selenium, BrowserStack, or PhantomJS.
1.43k stars 243 forks source link

Add verification for tests to run (FEATURE REQUEST) #569

Open joshm1204 opened 5 years ago

joshm1204 commented 5 years ago

I noticed that if I have a small bug in the code, some tests do not run at all and there is no warning or error that the spec did not run. This can lead to an unnoticed failure, which shoudl be fixed.

This is a feature request, to add a "number of tests" verification at the end. Every time a test spec is added, it would be nice to have a separate test spec that checks the number of tests run/passed.

describe("Number of Passing Tests for my_page_spec", function(){
   it("should have 20 passing tests", function() {
     number_of_passing_tests = (SOME FUNCTION)
     expect(number_of_passing_tests ).toEqual(20); 
   });
});

describe("Number of Passing Tests for Entire Test Suite", function(){
   it("should have 1000 passing tests", function() {
     number_of_passing_tests = (SOME FUNCTION)
     expect(number_of_passing_tests ).toEqual(1000); 
   });
});

Is there a way to do this or add this?