Skip to content

Commit

Permalink
feat(roll): roll to ToT Playwright (19-02-25) (#1677)
Browse files Browse the repository at this point in the history
  • Loading branch information
playwrightmachine authored Feb 19, 2025
1 parent 5417228 commit 53fd5e8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions nodejs/docs/test-components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,14 @@ export default defineConfig({
});
```
### How do I use CSS imports?
If you have a component that imports CSS, Vite will handle it automatically. You can also use CSS pre-processors such as Sass, Less, or Stylus, and Vite will handle them as well without any additional configuration. However, corresponding CSS pre-processor needs to be installed.
Vite has a hard requirement that all CSS Modules are named `*.module.[css extension]`. If you have a custom build config for your project normally and have imports of the form `import styles from 'styles.css'` you must rename your files to properly indicate they are to be treated as modules. You could also write a Vite plugin to handle this for you.
Check [Vite documentation](https://vite.dev/guide/features#css) for more details.
### How can I test components that uses Pinia?
Pinia needs to be initialized in `playwright/index.{js,ts,jsx,tsx}`. If you do this inside a `beforeMount` hook, the `initialState` can be overwritten on a per-test basis:
Expand Down

0 comments on commit 53fd5e8

Please sign in to comment.