Skip to content

Commit

Permalink
TINY-11177: Improved test failure reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSpyder committed Sep 16, 2024
1 parent 625a2ce commit b0dc184
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions modules/runner/src/test/ts/reporter/ReporterTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe('Reporter.test', () => {
reset();
const test = reporter.test(fileName + 'Test.ts', testName, testCount);
test.start();
return Promise.resolve().then(() => {
return reporter.waitForResults().then(() => {
assert.equal(startTestData.length, 1, 'Checking there is start test data');
assert.deepEqual(startTestData[0], {
currentCount: offset + 1,
Expand Down Expand Up @@ -113,15 +113,15 @@ describe('Reporter.test', () => {
test.skip(skippedMessage);
return reporter.waitForResults()
.then(() => {
assert.equal(endTestData.length, 1);
assert.equal(endTestData.length, 1, 'Checking there is end test data');
const data = endTestData[0];
assert.equal(data.session, sessionId);
assert.equal(data.file, fileName + 'Test.ts');
assert.equal(data.name, testName);
assert.isFalse(data.passed);
assert.equal(data.skipped, skippedMessage);
assert.isNull(data.error);
assert.isString(data.time);
assert.equal(data.session, sessionId, 'Checking session ID');
assert.equal(data.file, fileName + 'Test.ts', 'Checking filename');
assert.equal(data.name, testName, 'Checking testname');
assert.isFalse(data.passed, 'Checking passed state');
assert.equal(data.skipped, skippedMessage, 'Checking skipped message');
assert.isNull(data.error, 'Checking no error');
assert.isString(data.time, 'Checking time');

assert.deepEqual(reporter.summary(), {
offset,
Expand All @@ -145,15 +145,15 @@ describe('Reporter.test', () => {
test.fail(error);
return reporter.waitForResults()
.then(() => {
assert.equal(endTestData.length, 1);
assert.equal(endTestData.length, 1, 'Checking there is end test data');
const data = endTestData[ 0 ];
assert.equal(data.session, sessionId);
assert.equal(data.file, fileName + 'Test.ts');
assert.equal(data.name, testName);
assert.isFalse(data.passed);
assert.isNull(data.skipped);
assert.isString(data.time);
assert.equal(data.error?.text, 'Error: Failed\n\nLogs:\nLog Message');
assert.equal(data.session, sessionId, 'Checking session ID');
assert.equal(data.file, fileName + 'Test.ts', 'Checking filename');
assert.equal(data.name, testName, 'Checking testname');
assert.isFalse(data.passed, 'Checking passed state');
assert.isNull(data.skipped, 'Checking skipped state');
assert.isString(data.time, 'Checking time');
assert.equal(data.error?.text, 'Error: Failed\n\nLogs:\nLog Message', 'Checking error text');

assert.deepEqual(reporter.summary(), {
offset,
Expand Down

0 comments on commit b0dc184

Please sign in to comment.