0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00
astro/packages/webapi/test/media.js

21 lines
500 B
JavaScript
Raw Normal View History

import { expect } from 'chai'
import { polyfill } from '../mod.js'
describe('Media', () => {
const target = {}
2022-03-07 16:37:50 -05:00
before(() => polyfill(target))
2022-03-07 16:37:50 -05:00
it('Includes MediaQueryList functionality', () => {
expect(target).to.have.property('MediaQueryList')
expect(target).to.have.property('matchMedia')
})
2022-03-07 16:37:50 -05:00
it('Supports matchMedia creation', () => {
const mql = target.matchMedia('(min-width: 640px)')
expect(mql.matches).to.equal(false)
expect(mql.media).to.equal('(min-width: 640px)')
})
})