This relies on a hack to bypass the `mocha` detection by `grunt-mocha-phantomjs`.
The tests have to run in less than 10 seconds, which is unlikely to be problematic on current
hardware.
Alternatively, adding the following to tests/index.html also makes the old test suite compatible
with the mocha runner, but it entails loading `mocha`:
<script src="../node_modules/mocha/mocha.js"></script>
<script>
mocha.setup("bdd")
describe("dummy test", function(){
it("is a dummy test to run the old test suite with grunt-mocha-phantomjs like the new one", function(){})
})
mocha.run()
</script>
Bugfix for issue #1124
The condition has been changed, which is deciding to push the a route to history stack.
I think, it is necessary to compare the old route with the current route, instead of old route with root (without parameters).
Bugfix for issue #1124
The condition has been changed, which is deciding to push the a route to history stack.
I think, it is necessary to compare the old route with the current route, instead of old route with root (without parameters).
When a controller calls preventDefault on its onunload method, it prevents the current root element from being unmounted via a route change. But it does not prevent it from being unmounted via m.mount(root, null). In that case, the root element is unmounted, but any unloaders that it had keep hanging on the `unloaders` array, and that prevented any future m.mount(root, component) calls from succeeding. This is what was happening on the pending route() tests.
The fix is pretty simple: just reset the `unloaders` array when removing the root element, just like it's done when no unloader calls preventDefault.
Also, 2 of the 4 pending tests were removed because they were identical to the other 2.
Always consider the edge case of setting a <select> value when building an object. When a <select> node is reused, its option children can change, so its value attribute has to be re-assigned after its children have been recreated/updated.