Open nwaughachukwuma opened 3 years ago
Hey @nwaughachukwuma if you mean applying styles to a components to be tested you can add these as a prop to the mount
function, as described here.
https://github.com/bahmutov/cypress-svelte-unit-test#styles
In your case this would e.g. be:
// Greeting.spec.ts
import { mount } from 'cypress-svelte-unit-test'
import Greeting from './Greeting.svelte'
describe('Basic test', () => {
it('should render Greeting component', () => {
const greeting = 'Hey Cypress!';
mount(Greeting, { props: { greeting }, {
style: `
.basic {
display: block;
color: red;
background-color: blue;
}`
} });
cy.contains(greeting);
})
})
Thanks @sebastinez.
I get the following error, where I have the subsequently shown
.svelte
and.spec
files.