Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reversed argument order in .then #1772

Closed
superMDguy opened this issue May 24, 2018 · 2 comments
Closed

Reversed argument order in .then #1772

superMDguy opened this issue May 24, 2018 · 2 comments

Comments

@superMDguy
Copy link

superMDguy commented May 24, 2018

Current behavior:

According to this line, the .then function has a signature of (subject, options, fn). The docs say that, like most other cypress functions, the options is the last argument, so (subject, fn, options).

Desired behavior:

The signature should be (subject, fn, options), to be consistent with the docs and other cypress functions. However, that could break others' existing tests. So, maybe a better solution would be to just update the docs with the correct argument order.

Steps to reproduce:

n/a

Versions

n/a

@jennifer-shehane
Copy link
Member

The docs say that, like most other cypress functions, the options is the last argument, so (subject, fn, options)

The syntax indicates the options is the first argument (if needed) here:

screen shot 2018-05-25 at 10 32 30 am

I suppose you are referring to the order of the Arguments as listed, with the fn first and options last - indicating that this reflects the order or arguments.

This does seem to coincidentally be the case on most of the API docs. I seriously doubt we will change to order of the option in the API itself.

So, I created a new issue in our docs to update this here: cypress-io/cypress-documentation#618. Our documentation is open source and contributions are welcome. 😄

@superMDguy
Copy link
Author

Somehow I missed the syntax section, since I was looking at the arguments section. It's kind of strange that the options are the first argument in this command, but I agree that changing the docs is the best option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants