You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current behavior: ValidationRules.ensure(...) accepts both a string or a function. The string should be a property name, and the function should return the property. We are using a function to make use of the Typescript type checking. However, in our code coverage, these functions are mentioned as not being covered by the component tests. This is because the function is never actually executed, but parsed in the PropertyAccessorParser.
Desired behavior:
An easy solution would be to make the ensure(...) argument a keyof TObject. This would both cover the need for type checking and remove the need for a function parser.
The text was updated successfully, but these errors were encountered:
TimVevida
pushed a commit
to TimVevida/validation
that referenced
this issue
Apr 20, 2018
the keyof operator.
Calls to .ensure() allowed both a string and a function as argument. The
function was never actually executed, but parsed to get the string
property name. The same effect can be achieved by using the keyof
operator. In this case, only strings can be provided that are a property
of the given class.
Initial version, requiring the programmer to explicitly state the object
class each time .ensure() is executed. This is because .ensure() is a
static function, so the type cannot be determined yet.
Fixesaurelia#485.
TimVevida
pushed a commit
to TimVevida/validation
that referenced
this issue
Apr 20, 2018
the keyof operator.
Calls to .ensure() allowed both a string and a function as argument. The
function was never actually executed, but parsed to get the string
property name. The same effect can be achieved by using the keyof
operator. In this case, only strings can be provided that are a property
of the given class.
Initial version, requiring the programmer to explicitly state the object
class each time .ensure() is executed. This is because .ensure() is a
static function, so the type cannot be determined yet.
Fixesaurelia#485.
I'm submitting a feature request
1.1.2
Please tell us about your environment:
Operating System:
Linux (kubuntu)
Node Version:
6.14.1
3.10.10
JSPM 0.16.53
TypeScript 2.8.1
Current behavior:
ValidationRules.ensure(...)
accepts both a string or a function. The string should be a property name, and the function should return the property. We are using a function to make use of the Typescript type checking. However, in our code coverage, these functions are mentioned as not being covered by the component tests. This is because the function is never actually executed, but parsed in the PropertyAccessorParser.Desired behavior:
An easy solution would be to make the ensure(...) argument a
keyof TObject
. This would both cover the need for type checking and remove the need for a function parser.The text was updated successfully, but these errors were encountered: