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

Added recipe for writing test with code depending on a window object #585

Closed
wants to merge 1 commit into from

Conversation

0xjocke
Copy link
Contributor

@0xjocke 0xjocke commented Mar 1, 2016

I was debating if it should be called react-testing or browser-testing and decided to call it browser-testing since if solves a problem for all libraries that expect a global window object.

I'm happy to add changes based on feedback

@@ -0,0 +1,73 @@
# Setting up AVA for browser testing.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra "." here

@vadimdemedes
Copy link
Contributor

We had some users ask for this one previously. I like it, thank you for your work @bachstatter! If you could address fixes/suggestions, it'd be good to merge ;)


t.true(onUserBlur.calledOnce)
})
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

semicolons please

@0xjocke
Copy link
Contributor Author

0xjocke commented Mar 1, 2016

Thanks for all the feedback. English is my second language. Will update as soon as possible

# Setting up AVA for browser testing

AVA does not support running tests in browsers yet.
Some libraries require ```window``` object is defined.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line could be better:

Some libraries require browser specific globals (window, document, navigator, etc).

Also, You just need a single tick around window (not triple).

@jamestalmage
Copy link
Contributor

LGTM. Just some minor nits.

@@ -0,0 +1,69 @@
# Setting up AVA for browser testing

AVA does not support running tests in browsers yet.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link the word yet to the issue tracking browser support?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

sindresorhus pushed a commit that referenced this pull request Mar 2, 2016
@sindresorhus
Copy link
Member

Thank you @bachstatter. Good stuff :)

sindresorhus pushed a commit that referenced this pull request Mar 2, 2016
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

Successfully merging this pull request may close these issues.

5 participants