absolutely massive typescript porting time

This commit is contained in:
41666 2019-06-02 18:58:15 -05:00
parent 01f238f515
commit 30d08a630f
No known key found for this signature in database
GPG key ID: BC51D07640DC10AF
159 changed files with 2563 additions and 3861 deletions

View file

@ -0,0 +1,42 @@
/**
* @jest-environment jsdom
*/
/* eslint-env jest */
import MediaQuery, { xs, sm, md, lg, xl } from '../media'
describe('MediaQuery', () => {
it('outputs media queries', () => {
const mq = MediaQuery({
xs: 'font-size: 0.5em;',
sm: 'font-size: 1em;',
md: 'font-size: 1.5em;',
lg: 'font-size: 2em;',
xl: 'font-size: 2.5em;'
})
expect(mq).toMatchSnapshot()
})
})
describe('mediaTemplateLiteral', () => {
it('renders how we expect', () => {
// this is a weird fixture because of how we render MediaQuery for testing
const mq = `${xs`font-size: 0.5em;`}
${sm`font-size: 1em;`}
${md`font-size: 1.5em;`}
${lg`font-size: 2em;`}
${xl`font-size: 2.5em;`}`
expect(mq).toMatchSnapshot()
const mq2 = MediaQuery({//
xs: 'font-size: 0.5em;',
sm: 'font-size: 1em;',
md: 'font-size: 1.5em;',
lg: 'font-size: 2em;',
xl: 'font-size: 2.5em;'
})
expect(mq).toEqual(mq2)
})
})