-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Description
Current behavior
Following this migration guide, it is recommended to add (global) stylesheets to your tests. Nextjs's webpack wouldn't allow you to add them to your components anyway. But, when you add styles to a test, all tests (in cypress open-ct) hang on Your tests are loading....
import 'tailwindcss/tailwind.css' // or '../styles/index.css'
import { mount } from '@cypress/react'
import Button from '.'
describe('<Button />', () => {
it('should mount', () => {
mount(<Button />)
cy.contains('click me')
})
})Desired behavior
For the global styles to get applied.
Test code to reproduce
// cypress/plugins/index.ts
const injectNextDevServer = require('@cypress/react/plugins/next')
const pluginConfig: Cypress.PluginConfig = (on, config) => {
if (config.testingType === 'component') {
injectNextDevServer(on, config)
}
return config
}
module.exports = pluginConfigVersions
Cypress package version: 7.5.0
Cypress binary version: 7.5.0
Electron version: 12.0.0-beta.14
Bundled Node version: 14.15.1
OS: (Linux) 5.10.36-2-MANJAROMetadata
Metadata
Assignees
Labels
No labels