Итак, я только начал писать тесты для моего исполняемого javascript-приложения, используя sinon.js
и jasmine.js
. Работает довольно хорошо в целом, но мне также нужно проверить свои маршрутизаторы.
Маршрутизаторы в своем текущем состоянии будут вызывать несколько видов и других вещей, завершая текущий тест jasmine.js
, вызывая Backbone.navigate
в зависимости от состояния приложения и UI itneraction.
Итак, как я могу проверить, будет ли работать маршрутизация в разных местах, сохраняя маршрутизаторы "изолированными" и не позволяя им изменять маршрут?
Могу ли я настроить какую-то макетную функцию, которая будет отслеживать изменения pushState или аналогичные?