VBA-tools / vba-test

Add testing and TDD to VBA on Windows and Mac
MIT License
205 stars 46 forks source link

ImmediateReporter Silent Mode #19

Closed connerk closed 6 years ago

connerk commented 6 years ago

A simple way to silence Immediate window output

connerk commented 6 years ago

I suppose I should implement tests for this 😄

timhall commented 6 years ago

Hi @connerk thanks for the PR! What was your use case for silent mode? How do you get the results of your tests?

I think this can just be resolved by not connecting an ImmediateReporter in the first place. The SpecSuite runs by itself and the reporter listens to events from the suite and displays them in the console. To make it silent, I think the best bet is to skip the listenTo line. (The docs may have given a different impression since I like to have the console logging for all of my tests)

connerk commented 6 years ago

Hi @timhall thanks for the great tool. I finally found a test harness that works well! I run a patching system that updates an entire folder of similar workbooks. I run all patches, then all tests for each workbook. this ends up being tens of thousands of tests in the end. the patching system has its own console output I wanted to pay attention to during the process but all the test output was blowing by so quickly I couldn't see what was going on. I am still seeing the test output on the workbookReporter

When I run the tests outside the patcher, I do want to see the console output. so instead of going into each spec and commenting out the listenTo or building the switch into each test harness I build in the future, I thought it would be handy to turn the output on and off.

I also intend to build reporting levels for both the WorkbookReporter and the ImmediateReporter so that it will only report fails for instance.