Files
shields/services/deprecation-helpers.spec.js
chris48s 13d75e0607 upgrade to prettier 2 (#5051)
* arrowParens: avoid
* remove trailingComma setting
2020-05-05 21:07:43 +01:00

18 lines
523 B
JavaScript

'use strict'
const { expect } = require('chai')
const { Deprecated } = require('../core/base-service/errors')
const { enforceDeprecation } = require('./deprecation-helpers')
describe('enforceDeprecation', function () {
it('throws Deprecated for a date in the past', function () {
expect(() => enforceDeprecation(new Date())).to.throw(Deprecated)
})
it('does not throw for a date in the future', function () {
expect(() =>
enforceDeprecation(new Date(Date.now() + 10000))
).not.to.throw()
})
})