solid-testing-library: location option ignored
This might be related to #60 - I’m also using vitest.
The following test fails:
import { render, screen} from '@solidjs/testing-library'
import { Route, Router } from "@solidjs/router"
test.only('render location', async () => {
render(Component, {location: '/foo'})
expect(await screen.findByText('foo')).toBeTruthy()
})
function Component() {
return (
<Router>
<Route path='/' component={() => <p>root</p>}/>
<Route path='/foo' component={() => <p>foo</p>}/>
</Router>
)
}
If I change the findByText to ‘root’ it passes. Am I using the API correctly?
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 1
- Comments: 24
I can influence the testing config from the vite-plugin-solid, but not from @solidjs/testing-library.
It cannot be fixed in testing-library, but I am preparing a fix in vite-plugin-solid.