Skip to content

Commit

Permalink
patch(vest): use isPositive in parser
Browse files Browse the repository at this point in the history
  • Loading branch information
ealush committed Mar 20, 2022
1 parent 36b905a commit cdf6910
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/vest/src/exports/parser.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { greaterThan } from 'greaterThan';
import hasOwnProperty from 'hasOwnProperty';
import { isPositive } from 'isPositive';

import { SeverityCount } from 'Severity';
import { SuiteSummary } from 'genTestsSummary';
Expand Down Expand Up @@ -28,15 +28,15 @@ export function parse(res: SuiteRunResult | SuiteResult | SuiteSummary): {

function isTested(fieldName?: string): boolean {
if (!fieldName) {
return greaterThan(res.testCount, 0);
return isPositive(res.testCount);
}

if (hasOwnProperty(testedStorage, fieldName))
return testedStorage[fieldName];

testedStorage[fieldName] =
hasOwnProperty(res.tests, fieldName) &&
greaterThan(res.tests[fieldName].testCount, 0);
isPositive(res.tests[fieldName].testCount);

return selectors.tested(fieldName);
}
Expand Down Expand Up @@ -67,5 +67,5 @@ function hasFailures(
? res.tests?.[fieldName]?.[countKey]
: res[countKey] ?? 0;

return greaterThan(failureCount, 0);
return isPositive(failureCount);
}

1 comment on commit cdf6910

@vercel
Copy link

@vercel vercel bot commented on cdf6910 Mar 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

vest-next – ./website

vest-next.vercel.app
vest-website.vercel.app
vest-next-git-latest-ealush.vercel.app
vest-next-ealush.vercel.app

Please sign in to comment.