astro/packages/webapi/test/media.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

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 21:37:50 +00:00
before(() => polyfill(target))
2022-03-07 21:37:50 +00:00
it('Includes MediaQueryList functionality', () => {
expect(target).to.have.property('MediaQueryList')
expect(target).to.have.property('matchMedia')
})
2022-03-07 21:37:50 +00: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)')
})
})