Guy Korland Guy Korland - 1 year ago 116
Javascript Question

How to disable should.js override "should" property?

One of the external libraries we're using is having a property called "should" in one of its classes.

When we run tests with shouldjs it seems like should instruments its class with its "should" which crashes the library.

How can we hint shouldjs to avoid instrument this class?

Answer Source

Just to fill all posibilities.

You can require should.js via should/as-function and use it only as function, it will not try to extend Object.prototype in this case:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download