Skip to content

Commit

Permalink
patch(vest): remove incorrect messaging from group initialization error
Browse files Browse the repository at this point in the history
  • Loading branch information
ealush committed Oct 9, 2021
1 parent 5adc337 commit e538e5b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/vest/src/hooks/group.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ import isFunction from 'isFunction';
import isStringValue from 'isStringValue';
import throwError from 'throwError';

const throwGroupError = value =>
const throwGroupError = () =>
throwError(
__DEV__
? `group initialization error. Expected "${value}" to be a string.`
: 'group name must be a string'
"group initialization error. Incompatible argument passed to group."
);

/**
Expand All @@ -17,11 +15,11 @@ const throwGroupError = value =>
*/
const group = (groupName, tests) => {
if (!isStringValue(groupName)) {
throwGroupError(groupName);
throwGroupError();
}

if (!isFunction(tests)) {
throwGroupError(tests);
throwGroupError();
}

// Running with the context applied
Expand Down

0 comments on commit e538e5b

Please sign in to comment.