debug.js 334 B

1234567891011121314
  1. import { warn } from 'scroll/util/debug'
  2. describe('debug.js', () => {
  3. it('#warn()', () => {
  4. const originErr = console.error
  5. const error = sinon.spy()
  6. console.error = error
  7. const msg = 'test msg'
  8. warn(msg)
  9. expect(error)
  10. .to.be.calledWith(`[BScroll warn]: ${msg}`)
  11. console.error = originErr
  12. })
  13. })