You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
what are the guidelines in Chai regarding the runtime environment ? And more specifically for using some ES6 features :
use ES5 only, include code for missing features and use that code exclusively (never the ES6 version which may available in the environment)
This to be sure to run exactly the same code on all runtimes
use ES5 only, and include polyfilling code directly in the implementation.
This may lead to a less efficient code (environment adjustment is made in every call)
target ES5, and polyfill localy in chai.js
target ES5, and centralize all polyfills in a single util file
this could help remove polyfills later, or replace them by a third party polyfill component
I am asking because I need Number.isNaN() which is ES6 and has been natively available for a long time in Chrome (from v19) and Firefox (from v16).
I think this is may also be an interesting discussion for integration of ES6 specific features in chai (like isSymbol, String.isNormalized, Number.isFinite,closeTo using Number.EPSILON, testing typed arrays, iterators, computed property names...)
sorry if this has been discussed before, but I could not find any info in the site, the google group or the GitHub issues.
The text was updated successfully, but these errors were encountered:
Thanks for the issue @olivr70, it's a good question.
We don't really have an official stance, but in general we'll support ES6 features where we can. There's enough evidence mounting that we're keeping with the curve and supporting ES6:
Any new patches/PRs are reviewed on a case-per-case basis, generally with the thought toward forward and backward compat - but obviously some things slip through (like #498).
Hopefully this answers your question well enough. I'll close this issue now as its a question - feel free to continue the discussion though!
Hello,
what are the guidelines in Chai regarding the runtime environment ? And more specifically for using some ES6 features :
I am asking because I need Number.isNaN() which is ES6 and has been natively available for a long time in Chrome (from v19) and Firefox (from v16).
I think this is may also be an interesting discussion for integration of ES6 specific features in chai (like isSymbol, String.isNormalized, Number.isFinite,closeTo using Number.EPSILON, testing typed arrays, iterators, computed property names...)
sorry if this has been discussed before, but I could not find any info in the site, the google group or the GitHub issues.
The text was updated successfully, but these errors were encountered: