cypress-svelte-unit-test icon indicating copy to clipboard operation
cypress-svelte-unit-test copied to clipboard

External CSS won't get loaded

Open wyozi opened this issue 4 years ago • 1 comments

If there exists a CSS rollup config that separates the associated CSS into another file (as is done in default rollup template https://github.com/sveltejs/template/blob/master/rollup.config.js#L23-L25), the tests won't have access to the CSS

Workaround is to disable those lines in test mode.

wyozi avatar May 15 '20 03:05 wyozi

Another workaround is to include the bundled CSS file while mounting the component:

mount(HelloWorld, {
  props: {name: 'World'}
}, {
  stylesheet: '/__root/public/build/bundle.css',
})

johanbissemattsson avatar Nov 25 '20 14:11 johanbissemattsson