Simplifies the testing of UI components by providing an elegant, fluent interface for arranging test setups along with a number of runtime debug/test helpers.
MIT License
40
stars
27
forks
source link
Type inconsistency in waitFor, waitForElement, & waitForElements #72
Current behavior:
The type definition for waitForElement, waitForElements and waitFor define the second options argument as required (options: any). The ComponentTester's unit test suggests that the second argument is optional as it omits it entirely.
This inconsistent definition forces TypeScript users to unnecessarily pass in an empty object to satisfy the type definition, therefore I think the definition should be changed to options?: any.
This is reinforced by the official docs which state the first argument, selector, as mandatory, but pose no such restriction on the options argument.
Expected/desired behavior:
What is the expected behavior?
The type definition of the second argument (options) for the waitForElement, waitForElements, and the waitFor functions should be updated to make the options argument optional (i.e. options?: any).
What is the motivation / use case for changing the behavior?
Consistent type definitions with example usage and existing technical documentation.
Avoid forcing TypeScript users to unnecessarily pass in an empty object as the argument.
I'm submitting a bug report
Please tell us about your environment:
Operating System: Linux (Fedora 25)
Node Version: 6.11.0
NPM Version: 3.10.10
JSPM OR Webpack AND Version webpack 3.3.0
Browser: all
Language: all
Current behavior: The type definition for
waitForElement
,waitForElements
andwaitFor
define the secondoptions
argument as required (options: any
). TheComponentTester
's unit test suggests that the second argument is optional as it omits it entirely.This inconsistent definition forces TypeScript users to unnecessarily pass in an empty object to satisfy the type definition, therefore I think the definition should be changed to
options?: any
.This is reinforced by the official docs which state the first argument,
selector
, as mandatory, but pose no such restriction on theoptions
argument.Expected/desired behavior:
What is the expected behavior?
options
) for thewaitForElement
,waitForElements
, and thewaitFor
functions should be updated to make theoptions
argument optional (i.e.options?: any
).What is the motivation / use case for changing the behavior?