/** * ### specDone * * `specDone` is invoked when an `it` and its associated `beforeEach` and `afterEach` functions have been run. * * While jasmine doesn't require any specific functions, not defining a `specDone` will make it impossible for a reporter to know when a spec has failed. */ public void specDone(ReporterResult result) { /** * The result here is the same object as in `specStarted` but with the addition of a status and a list of failedExpectations. */ Console.WriteLine("Spec: " + result.description + " was " + result.status); for (var i = 0; i < result.failedExpectations.Length; i++) { /** * Each `failedExpectation` has a message that describes the failure and a stack trace. */ Console.WriteLine("Failure: " + result.failedExpectations[i].message); Console.WriteLine(result.failedExpectations[i].stack); } }
/** * ### suiteDone * * `suiteDone` is invoked when all of the child specs and suites for a given suite have been run * * While jasmine doesn"t require any specific functions, not defining a `suiteDone` will make it impossible for a reporter to know when a suite has failures in an `afterAll`. */ public void suiteDone(ReporterResult result) { /** * The result here is the same object as in `suiteStarted` but with the addition of a status and a list of failedExpectations. */ Console.WriteLine("Suite: " + result.description + " was " + result.status); for (var i = 0; i < result.failedExpectations.Length; i++) { /** * Any `failedExpectation`s on the suite itself are the result of a failure in an `afterAll`. * Each `failedExpectation` has a message that describes the failure and a stack trace. */ Console.WriteLine("AfterAll " + result.failedExpectations[i].message); Console.WriteLine(result.failedExpectations[i].stack); } }
/** * ### specStarted * * `specStarted` is invoked when an `it` starts to run (including associated `beforeEach` functions) */ public void specStarted(ReporterResult result) { /** * the result contains some meta data about the spec itself. */ Console.WriteLine("Spec started: " + result.description + " whose full description is: " + result.fullName); }