solid-testing-library
solid-testing-library copied to clipboard
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?