I am trying to run a test that has CSS.supports() function in it.
describe('something', () => {
it('fails',() => {
CSS.supports('display', 'flex');
} )
})
I get this error: ReferenceError: CSS is not defined.
Shouldn't JSDOM support this function? Thanks!
This is not implemented in JSDom, but you can code around it by checking if CSS.supports exists and then the tests won't fail like so:
const supportsDvh = CSS.supports && CSS.supports('height: 100dvh');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With