mirror of
https://github.com/withastro/astro.git
synced 2024-12-23 21:53:55 -05:00
f18ee36dc0
* chore: add @astrojs/webapi * chore: update package.json * fix: update file case * fix: remove lowercase file * chore: update tests to use mocha * chore: update LICENSE
31 lines
621 B
JavaScript
31 lines
621 B
JavaScript
import { assert, test } from '../run/test.setup.js'
|
|
import { polyfill } from '../mod.js'
|
|
|
|
test(() => {
|
|
return [
|
|
{
|
|
name: 'Includes MediaQueryList functionality',
|
|
test() {
|
|
const target = {}
|
|
|
|
polyfill(target)
|
|
|
|
assert.equal(Reflect.has(target, 'MediaQueryList'), true)
|
|
assert.equal(Reflect.has(target, 'matchMedia'), true)
|
|
},
|
|
},
|
|
{
|
|
name: 'Supports matchMedia creation',
|
|
test() {
|
|
const target = {}
|
|
|
|
polyfill(target)
|
|
|
|
const mql = target.matchMedia('(min-width: 640px)')
|
|
|
|
assert.equal(mql.matches, false)
|
|
assert.equal(mql.media, '(min-width: 640px)')
|
|
},
|
|
},
|
|
]
|
|
})
|