You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and then a test in the separate test/ directory using vite.
// test/App.test.tsximport{expect,test}from'vitest'import{render}from'vitest-browser-react'importAppfrom'../src/App.tsx'test('renders name',async()=>{const{ getByText }=awaitrender(<App/>)awaitexpect.element(getByText('Click on the Vite')).toBeInTheDocument()})
The problem is that, much like many other people, I encountered this error
FAIL chromium test/App.test.tsx [ test/App.test.tsx ]
Error: Failed to import test file /Users/federico.panico/vite-project/test/App.test.tsx
Caused by: Error: Styles were unable to be assigned to a file. This is generally caused by one of the following:
- You may have created styles outside of a '.css.ts' context
- You may have incorrect configuration. See https://vanilla-extract.style/documentation/getting-started
BUT one thing I noticed is that if move the test from test/App.test.tsx to src/App.test.tsx, the test actually runs and passes. Is this an expected behaviour?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have a minimal project where I have three files.
and then a test in the separate
test/directory using vite.The problem is that, much like many other people, I encountered this error
My
vitest.config.tsis fairly normal.BUT one thing I noticed is that if move the test from
test/App.test.tsxtosrc/App.test.tsx, the test actually runs and passes. Is this an expected behaviour?Beta Was this translation helpful? Give feedback.
All reactions