Open mrjgreen opened 1 year ago
Name | Link |
---|---|
Latest commit | 49556ce931eaad30ad92788187d1e9fceb45e670 |
Latest deploy log | https://app.netlify.com/sites/routify-v3-example/deploys/651bc4a8d12d6f00085d66b5 |
Thank you so much for this.
No problem - I've no idea if this will work in CI, but it's a starting point for me to try and figure out why the module replacement doesn't seem to be working for me.
I'd be keen to help get these tests into a useful shape though so if you think this could be something we eventually want to merge I'd be happy to make any required changes.
Thanks again for the PR. I'm thinking this should probably be an integration test rather than E2E. I don't know if this is something you want to try. If not, I'll be happy to do it.
Also, are you on Discord by any chance?
I'd be happy enough to try - would that belong in test/integration/routify-runtime/routify.test.js
?
I'm not on discord.
I think the best place would be test/integration/composition
. Similar to test/integration/meta
.
You would have to do something like
const { default: routes } = await import('./temp/routes.default.js')
const instance = new RoutifyRuntime({ routes })
const router = instance.routers[0]
await router.url.push('/some/route')
const route = router.activeRoute.get()
// run tests on route.fragments. Each fragment contains a node with a component to be rendered. Eg. a `reset` would have fewer fragments than a `prepend`
assert.equal(route.fragments.map(fragment => fragment.node.name), [/*names of nodes to be rendered*/])
But really. You should only do this for your enjoyment since I expect you might hit some obstacles due to the lack of documentation for R3s internal code.
test with