Skip to content

Commit

Permalink
patch(vest): add statusEquals VestTest method
Browse files Browse the repository at this point in the history
  • Loading branch information
ealush committed Feb 6, 2022
1 parent 02e08d6 commit 072ccde
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/n4s/src/runtime/runtimeRules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function getRule(ruleName: string): TRuleBase {

export { baseRules, getRule };

export type TRules<E = Record<string, unknown>> = n4s.EnforceCustomMatchers<
type TRules<E = Record<string, unknown>> = n4s.EnforceCustomMatchers<
TRules<E> & E
> &
Record<string, (...args: TArgs) => TRules<E> & E> & {
Expand Down
20 changes: 12 additions & 8 deletions packages/vest/src/core/test/VestTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,39 +142,43 @@ export default class VestTest {
}

isPending(): boolean {
return this.status === STATUS_PENDING;
return this.statusEquals(STATUS_PENDING);
}

isTested(): boolean {
return this.hasFailures() || this.isPassing();
}

isOmitted(): boolean {
return this.status === STATUS_OMITTED;
return this.statusEquals(STATUS_OMITTED);
}

isUntested(): boolean {
return this.status === STATUS_UNTESTED;
return this.statusEquals(STATUS_UNTESTED);
}

isFailing(): boolean {
return this.status === STATUS_FAILED;
return this.statusEquals(STATUS_FAILED);
}

isCanceled(): boolean {
return this.status === STATUS_CANCELED;
return this.statusEquals(STATUS_CANCELED);
}

isSkipped(): boolean {
return this.status === STATUS_SKIPPED;
return this.statusEquals(STATUS_SKIPPED);
}

isPassing(): boolean {
return this.status === STATUS_PASSING;
return this.statusEquals(STATUS_PASSING);
}

isWarning(): boolean {
return this.status === STATUS_WARNING;
return this.statusEquals(STATUS_WARNING);
}

statusEquals(status: KStatus): boolean {
return this.status === status;
}
}

Expand Down

1 comment on commit 072ccde

@vercel
Copy link

@vercel vercel bot commented on 072ccde Feb 6, 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-website.vercel.app
vest-next.vercel.app
vest-next-ealush.vercel.app
vest-next-git-latest-ealush.vercel.app

Please sign in to comment.