Chai: Make proxies optional

Created on 6 Aug 2016  路  4Comments  路  Source: chaijs/chai

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.

fun-size pull-request-wanted

Most helpful comment

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

Thank you

All 4 comments

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

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

Thank you

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 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  4Comments

basherr picture basherr  路  4Comments

zzzgit picture zzzgit  路  3Comments

sverrirs picture sverrirs  路  3Comments

liborbus picture liborbus  路  4Comments