common_bootstrap.js 585 B

123456789101112131415161718192021222324
  1. const chai = require('chai')
  2. /*
  3. * Chai configuration
  4. */
  5. // add chai.should()
  6. chai.should()
  7. // Load sinon-chai assertions so expect(stubFn).to.have.been.calledWith('abc')
  8. // has a nicer failure messages
  9. chai.use(require('sinon-chai'))
  10. // Load promise support for chai
  11. chai.use(require('chai-as-promised'))
  12. // Do not truncate assertion errors
  13. chai.config.truncateThreshold = 0
  14. // add support for mongoose in sinon
  15. require('sinon-mongoose')
  16. // ensure every ObjectId has the id string as a property for correct comparisons
  17. require('mongodb-legacy').ObjectId.cacheHexString = true