Skip to content

Commit

Permalink
types(vest): use only SuiteSummary in classnames
Browse files Browse the repository at this point in the history
  • Loading branch information
ealush committed Mar 21, 2022
1 parent 24ef7f0 commit bec71a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions packages/vest/src/exports/classnames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ import isFunction from 'isFunction';

import { SuiteSummary } from 'genTestsSummary';
import { parse } from 'parser';
import type { SuiteResult } from 'produceSuiteResult';
import type { SuiteRunResult } from 'produceSuiteRunResult';

/**
* Creates a function that returns class names that match the validation result
*/
export default function classnames(
res: SuiteRunResult | SuiteResult | SuiteSummary,
res: SuiteSummary,
classes: TSupportedClasses = {}
): (fieldName: string) => string {
const selectors = parse(res);
Expand Down
4 changes: 1 addition & 3 deletions packages/vest/src/exports/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import { isPositive } from 'isPositive';

import { SeverityCount } from 'Severity';
import { SuiteSummary } from 'genTestsSummary';
import type { SuiteResult } from 'produceSuiteResult';
import type { SuiteRunResult } from 'produceSuiteRunResult';

// eslint-disable-next-line max-lines-per-function
export function parse(res: SuiteRunResult | SuiteResult | SuiteSummary): {
export function parse(res: SuiteSummary): {
valid: (fieldName?: string) => boolean;
tested: (fieldName?: string) => boolean;
invalid: (fieldName?: string) => boolean;
Expand Down

0 comments on commit bec71a8

Please sign in to comment.