-
Notifications
You must be signed in to change notification settings - Fork 595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add v6 tests (WIP) #528
Add v6 tests (WIP) #528
Conversation
also disable failing server rendering test and add failing nanohref test
Oops, that thould not contain |
This is all great! |
- route handler is passed state and emit - state includes current route - use is passed state and emitter - state includes query
accidentally committed
var Nanobus = require('nanobus') | ||
require('jsdom-global')(null, { url: 'http://localhost/' }) | ||
window.localStorage = window.localStorage || {} // See: yoshuawuyts/nanotiming#7 | ||
window.requestAnimationFrame = window.requestAnimationFrame || function (cb) { process.nextTick(cb) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks a little tricky; perhaps using https://github.com/juliangruber/tape-run might make it easier by testing in an actual browser env?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh heck yeah, that'd make it easier. At least 1 other test simply wouldn't work otherwise too. Glad to hear you're good using that.
@timwis do you think this could be merged? |
@timwis do you have time to rebase and merge soon? else would you mind if i do it? 😛 |
I'm sooooo sorry I missed your comments! I was subscribed to all activity on the repo and got behind reading every single comment, so didn't realise I was mentioned here. I started to rebase this but decided to start over in another branch with hopefully better tests. Just submitted another PR. |
Replaces #528. I was just going off the features listed in the readme. There are a handful more we should test but this is a start. Note that this includes a readme change for `state.href` that I believe was incorrectly documented. Let me know if I got that wrong. Also note that we should delete the original `v6-tests` branch once this is merged. Leaving it for now for reference.
Not ready to merge yet, work in progress. Jotted down ideas for tests below. Let me know if any don't make sense, and feel free to add other ideas.
Unit test ideas
.route
registers the route.use
is passed state, emitter, and apphigher level (closer to integration tests)
*
route called by default/*
route works too (maybe nanorouter)