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

Make proxies optional #766

Closed
meeber opened this issue Aug 6, 2016 · 4 comments
Closed

Make proxies optional #766

meeber opened this issue Aug 6, 2016 · 4 comments

Comments

@meeber
Copy link
Contributor

meeber commented Aug 6, 2016

Some people might not want to have their assertions boxed inside proxies, perhaps due to performance considerations. Since proxies are already automatically disabled in environments that don't support proxies, it should be easy to also make it possible to manually disable them via a Chai config value.

@meeber
Copy link
Contributor Author

meeber commented Aug 6, 2016

This is a good opportunity for anyone wanting to contribute to Chai. New contributors encouraged. Post a comment here before starting so no one duplicates effort. Also please review the contributor guidelines before opening a PR. The team is happy to answer any questions.

Requirements:

  • Add tests proving that proxies are used when useProxy is true, and aren't used when useProxy is false (see test/configuration.js)
  • The new tests should only be run if the current environment supports proxies (see test/expect.js for example)
  • Add a new config directive called useProxy that defaults to true (see lib/chai/config.js)
  • Update logic to only use proxies when useProxy is set to true (see lib/chai/utils/proxify.js)
  • If the user's environment doesn't support proxies, then the existing behavior of not using proxies should be maintained, even if the value of useProxy is set to true

@vieiralucas
Copy link
Member

Hello @meeber
I'm interested in solving this issue.

Thank you

@keithamus
Copy link
Member

Hey @vieiralucas - if you're interested in fixing this then please, go right ahead and make a PR. Put it up as soon as you want us to critique it and we can make sure it's what we want before merging 👍

@meeber
Copy link
Contributor Author

meeber commented Aug 15, 2016

Closed via #770

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

No branches or pull requests

3 participants