Skip to content

Commit

Permalink
Merge pull request #198 from no23reason/issue-197-todo-tests
Browse files Browse the repository at this point in the history
fix: handle todo tests properly
  • Loading branch information
no23reason authored May 2, 2020
2 parents fb9a939 + e9146e2 commit acd327e
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 54 deletions.
55 changes: 55 additions & 0 deletions src/__tests__/trx-generator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,61 @@ describe("trx-generator", (): void => {
expect(result).toBeTruthy();
});

it("handles todo tests", (): void => {
const input: AggregatedResult = {
numFailedTestSuites: 0,
numFailedTests: 0,
numPassedTestSuites: 0,
numPassedTests: 0,
numPendingTestSuites: 0,
numPendingTests: 0,
numRuntimeErrorTestSuites: 0,
numTodoTests: 1,
numTotalTestSuites: 1,
numTotalTests: 1,
openHandles: [],
snapshot: emptySnapshotSummary,
startTime: 1511376995239,
success: true,
testResults: [
{
leaks: false,
numFailingTests: 0,
numPassingTests: 0,
numPendingTests: 0,
numTodoTests: 1,
openHandles: [],
perfStats: {
end: 1511376996104,
start: 1511376995923,
},
snapshot: emptySnapshot,
testFilePath: "C:\\Users\\Github\\test\\test.spec.js",
testResults: [
{
ancestorTitles: [],
duration: 0,
failureMessages: [],
fullName: "first",
numPassingAsserts: 0,
status: "todo",
title: "first",
location: {
column: 0,
line: 0,
},
},
],
sourceMaps: {},
skipped: true,
},
],
wasInterrupted: false,
};
const result = generateTrx(input);
expect(result).toBeTruthy();
});

it("verify runtime suite failures", done => {
const input: AggregatedResult = {
numFailedTestSuites: 0,
Expand Down
3 changes: 2 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ export const getSuitePerTestDuration = (testSuiteResult: TestResult): number =>
(testSuiteResult.perfStats.end - testSuiteResult.perfStats.start) /
(testSuiteResult.numPassingTests +
testSuiteResult.numFailingTests +
testSuiteResult.numPendingTests),
testSuiteResult.numPendingTests +
testSuiteResult.numTodoTests),
);

export const getEnvInfo = (
Expand Down
56 changes: 3 additions & 53 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -762,16 +762,6 @@
regexpp "^3.0.0"
tsutils "^3.17.1"

"@typescript-eslint/[email protected]":
version "2.28.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.28.0.tgz#1fd0961cd8ef6522687b4c562647da6e71f8833d"
integrity sha512-4SL9OWjvFbHumM/Zh/ZeEjUFxrYKtdCi7At4GyKTbQlrj1HcphIDXlje4Uu4cY+qzszR5NdVin4CCm6AXCjd6w==
dependencies:
"@types/json-schema" "^7.0.3"
"@typescript-eslint/typescript-estree" "2.28.0"
eslint-scope "^5.0.0"
eslint-utils "^2.0.0"

"@typescript-eslint/[email protected]":
version "2.29.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.29.0.tgz#3cb8060de9265ba131625a96bbfec31ba6d4a0fe"
Expand All @@ -792,19 +782,6 @@
"@typescript-eslint/typescript-estree" "2.29.0"
eslint-visitor-keys "^1.1.0"

"@typescript-eslint/[email protected]":
version "2.28.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.28.0.tgz#d34949099ff81092c36dc275b6a1ea580729ba00"
integrity sha512-HDr8MP9wfwkiuqzRVkuM3BeDrOC4cKbO5a6BymZBHUt5y/2pL0BXD6I/C/ceq2IZoHWhcASk+5/zo+dwgu9V8Q==
dependencies:
debug "^4.1.1"
eslint-visitor-keys "^1.1.0"
glob "^7.1.6"
is-glob "^4.0.1"
lodash "^4.17.15"
semver "^6.3.0"
tsutils "^3.17.1"

"@typescript-eslint/[email protected]":
version "2.29.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.29.0.tgz#1be6612bb02fc37ac9f466521c1459a4744e8d3a"
Expand Down Expand Up @@ -3694,17 +3671,7 @@ jest-config@^25.4.0:
pretty-format "^25.4.0"
realpath-native "^2.0.0"

jest-diff@^25.2.1:
version "25.2.6"
resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-25.2.6.tgz#a6d70a9ab74507715ea1092ac513d1ab81c1b5e7"
integrity sha512-KuadXImtRghTFga+/adnNrv9s61HudRMR7gVSbP35UKZdn4IK2/0N0PpGZIqtmllK9aUyye54I3nu28OYSnqOg==
dependencies:
chalk "^3.0.0"
diff-sequences "^25.2.6"
jest-get-type "^25.2.6"
pretty-format "^25.2.6"

jest-diff@^25.4.0:
jest-diff@^25.2.1, jest-diff@^25.4.0:
version "25.4.0"
resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-25.4.0.tgz#260b70f19a46c283adcad7f081cae71eb784a634"
integrity sha512-kklLbJVXW0y8UKOWOdYhI6TH5MG6QAxrWiBMgQaPIuhj3dNFGirKCd+/xfplBXICQ7fI+3QcqHm9p9lWu1N6ug==
Expand Down Expand Up @@ -5602,17 +5569,7 @@ prepend-http@^1.0.1:
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc"
integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=

pretty-format@^25.2.1, pretty-format@^25.2.6:
version "25.2.6"
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.2.6.tgz#542a1c418d019bbf1cca2e3620443bc1323cb8d7"
integrity sha512-DEiWxLBaCHneffrIT4B+TpMvkV9RNvvJrd3lY9ew1CEQobDzEXmYT1mg0hJhljZty7kCc10z13ohOFAE8jrUDg==
dependencies:
"@jest/types" "^25.2.6"
ansi-regex "^5.0.0"
ansi-styles "^4.0.0"
react-is "^16.12.0"

pretty-format@^25.4.0:
pretty-format@^25.2.1, pretty-format@^25.2.6, pretty-format@^25.4.0:
version "25.4.0"
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.4.0.tgz#c58801bb5c4926ff4a677fe43f9b8b99812c7830"
integrity sha512-PI/2dpGjXK5HyXexLPZU/jw5T9Q6S1YVXxxVxco+LIqzUFHXIbKZKdUVt7GcX7QUCr31+3fzhi4gN4/wUYPVxQ==
Expand Down Expand Up @@ -7307,14 +7264,7 @@ which@^1.2.14, which@^1.2.9, which@^1.3.0, which@^1.3.1:
dependencies:
isexe "^2.0.0"

which@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/which/-/which-2.0.1.tgz#f1cf94d07a8e571b6ff006aeb91d0300c47ef0a4"
integrity sha512-N7GBZOTswtB9lkQBZA4+zAXrjEIWAUOB93AvzUiudRzRxhUdLURQ7D/gAIMY1gatT/LTbmbcv8SiYazy3eYB7w==
dependencies:
isexe "^2.0.0"

which@^2.0.2:
which@^2.0.1, which@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"
integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==
Expand Down

0 comments on commit acd327e

Please sign in to comment.