Files
shields/services/deprecation-helpers.spec.js
Paul Melnikow a801450dd6 Move deprecation helpers to services/ (#3162)
This is currently unused, though it seems fine to keep it around.
2019-03-05 20:32:41 -06:00

18 lines
520 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()
})
})