styled-components
Version:
Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress 💅
34 lines (28 loc) • 740 B
JavaScript
import StyledError from '../error'
describe('development', () => {
it('returns a rich error', () => {
expect(() => {
throw new StyledError(2)
}).toThrowErrorMatchingSnapshot()
})
it('allows interpolation', () => {
expect(() => {
throw new StyledError(1, 'foo')
}).toThrowErrorMatchingSnapshot()
})
})
describe('production', () => {
beforeEach(() => {
process.env.NODE_ENV = 'production'
})
it('returns an error link', () => {
expect(() => {
throw new StyledError(2)
}).toThrowErrorMatchingSnapshot()
})
it('returns an error link with interpolations if given', () => {
expect(() => {
throw new StyledError(1, 'foo')
}).toThrowErrorMatchingSnapshot()
})
})