Skip to content

Commit

Permalink
Add unit test for testSuite->tests attribute existence and correctness
Browse files Browse the repository at this point in the history
  • Loading branch information
palmerj3 committed Nov 15, 2017
1 parent e78b16f commit c35c423
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions __tests__/buildJsonResults.test.js
Expand Up @@ -4,6 +4,13 @@ const buildJsonResults = require('../utils/buildJsonResults');
const constants = require('../constants/index');

describe('buildJsonResults', () => {
it('should contain number of tests in testSuite', () => {
const noFailingTestsReport = require('../__mocks__/no-failing-tests.json');
const jsonResults = buildJsonResults(noFailingTestsReport, '', constants.DEFAULT_OPTIONS);

expect(jsonResults.testsuites[1].testsuite[0]._attr.tests).toBe(1);
});

it('should return the proper name from ancestorTitles when usePathForSuiteName is "false"', () => {
const noFailingTestsReport = require('../__mocks__/no-failing-tests.json');
const jsonResults = buildJsonResults(noFailingTestsReport, '', constants.DEFAULT_OPTIONS);
Expand Down

0 comments on commit c35c423

Please sign in to comment.