Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Avatar for KuCalc : devops.
Download
50663 views
1
//reset these each test
2
var activity;
3
4
//create the router
5
var router = new Router();
6
7
//setup/takedown
8
module("SS.js", {
9
setup: function() {
10
window.location.hash = "";
11
activity = 0;;
12
},
13
teardown: function() {
14
window.location.hash = "";
15
}
16
});
17
18
19
asyncTest("adhoc routing", function() {
20
21
//
22
23
router.path('/a', function() {
24
25
// the bennifit of calling `this.route` as opposed to `this.get` or `this.post` is that
26
// you can continue to define the route structure (ad-hoc) and then assign units of logic
27
// per event type, there will be less repetition of definition, and the code will be more
28
// readable/centralized.
29
30
this.path('/b', {
31
on: function() {},
32
after: function() {}
33
before: function() {}
34
});
35
36
});
37
38
window.location.hash = "/a";
39
40
});
41
42