However, since the upgrade to babel 6, to use Reflect requires babel-polyfill; which doesn't seem to work properly when required in protractor.conf.js.
To workaround this, the code has been changed back to using Object; and we have included exceptions in the prefer-reflect rule config for defineProperty and getOwnPropertyDescriptor methods so that they don't trigger a warning:
Once node@6.0.0 arrives, which should have native support for Reflect; we can remove the eslint exceptions, and revert back to using the Reflect API natively.
In
protractor.conf.js
, theonPrepare()
function attaches Chai'sshould
property to all objects.Due to
eslint
'sprefer-reflect
rule, we do this using the Reflect API:However, since the upgrade to
babel 6
, to use Reflect requiresbabel-polyfill
; which doesn't seem to work properly when required inprotractor.conf.js
.To workaround this, the code has been changed back to using
Object
; and we have included exceptions in theprefer-reflect
rule config fordefineProperty
andgetOwnPropertyDescriptor
methods so that they don't trigger a warning:Once
node@6.0.0
arrives, which should have native support for Reflect; we can remove theeslint
exceptions, and revert back to using the Reflect API natively.