-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mark "todo" tests as skipped #261
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
{ | ||
"numFailedTestSuites": 0, | ||
"numFailedTests": 0, | ||
"numPassedTestSuites": 1, | ||
"numPassedTests": 1, | ||
"numPendingTestSuites": 0, | ||
"numPendingTests": 0, | ||
"numRuntimeErrorTestSuites": 0, | ||
"numTodoTests": 1, | ||
"numTotalTestSuites": 1, | ||
"numTotalTests": 2, | ||
"snapshot": { | ||
"added": 0, | ||
"failure": false, | ||
"filesAdded": 0, | ||
"filesRemoved": 0, | ||
"filesUnmatched": 0, | ||
"filesUpdated": 0, | ||
"matched": 0, | ||
"total": 0, | ||
"unchecked": 0, | ||
"unmatched": 0, | ||
"updated": 0 | ||
}, | ||
"startTime": 1489712747092, | ||
"success": true, | ||
"testResults": [ | ||
{ | ||
"console": null, | ||
"failureMessage": null, | ||
"numFailingTests": 0, | ||
"numPassingTests": 1, | ||
"numPendingTests": 0, | ||
"numTodoTests": 1, | ||
"perfStats": { | ||
"end": 1489712747644, | ||
"start": 1489712747524 | ||
}, | ||
"snapshot": { | ||
"added": 0, | ||
"fileDeleted": false, | ||
"matched": 0, | ||
"unchecked": 0, | ||
"unmatched": 0, | ||
"updated": 0 | ||
}, | ||
"testFilePath": "/path/to/test/__tests__/foo.test.js", | ||
"testResults": [ | ||
{ | ||
"ancestorTitles": [ | ||
"foo", | ||
"baz" | ||
], | ||
"duration": 1, | ||
"failureMessages": [], | ||
"fullName": "foo baz should bar", | ||
"numPassingAsserts": 0, | ||
"status": "passed", | ||
"title": "should bar" | ||
}, | ||
{ | ||
"ancestorTitles": [ | ||
"foo", | ||
"bar" | ||
], | ||
"duration": 0, | ||
"failureDetails": [], | ||
"failureMessages": [], | ||
"fullName": "foo bar should baz", | ||
"invocations": 1, | ||
"location": null, | ||
"numPassingAsserts": 0, | ||
"retryReasons": [], | ||
"status": "todo", | ||
"title": "should baz" | ||
} | ||
], | ||
"skipped": false | ||
} | ||
], | ||
"wasInterrupted": false | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,6 +102,16 @@ const generateTestCase = function(junitOptions, suiteOptions, tc, filepath, file | |
}); | ||
} | ||
|
||
if (tc.status === 'todo') { | ||
testCase.testcase.push({ | ||
skipped: { | ||
_attr: { | ||
message: "todo" | ||
} | ||
} | ||
}); | ||
} | ||
|
||
if (getGetCaseProperties !== null) { | ||
let junitCaseProperties = getGetCaseProperties(tc); | ||
|
||
|
@@ -216,7 +226,7 @@ module.exports = function (report, appDirectory, options, rootDir = null) { | |
suiteNameVariables[constants.DISPLAY_NAME_VAR] = displayName; | ||
|
||
// Add <testsuite /> properties | ||
const suiteNumTests = suite.numFailingTests + suite.numPassingTests + suite.numPendingTests; | ||
const suiteNumTests = suite.numFailingTests + suite.numPassingTests + suite.numPendingTests + (suite.numTodoTests ? suite.numTodoTests : 0); | ||
const suiteExecutionTime = executionTime(suite.perfStats.start, suite.perfStats.end); | ||
|
||
const suiteErrors = noResults ? 1 : 0; | ||
|
@@ -226,7 +236,7 @@ module.exports = function (report, appDirectory, options, rootDir = null) { | |
name: replaceVars(suiteOptions.suiteNameTemplate, suiteNameVariables), | ||
errors: suiteErrors, | ||
failures: suite.numFailingTests, | ||
skipped: suite.numPendingTests, | ||
skipped: suite.numPendingTests + (suite.numTodoTests ? suite.numTodoTests : 0), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ... and the But, if Anyone know? |
||
timestamp: (new Date(suite.perfStats.start)).toISOString().slice(0, -5), | ||
time: suiteExecutionTime, | ||
tests: suiteNumTests | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this always comes out set to 0 - if so I think the rest of the .json files should be updated to reflect this ...