|
1 | 1 | import { FlowRouter, Route } from 'meteor/ostrio:flow-router-extra';
|
| 2 | +import { Random } from 'meteor/random'; |
2 | 3 |
|
3 | 4 | Tinytest.addAsync('Client - Triggers - global enter triggers', function(test, next) {
|
4 | 5 | var rand = Random.id(), rand2 = Random.id();
|
@@ -112,26 +113,27 @@ Tinytest.addAsync('Client - Triggers - global enter triggers with "except"', fun
|
112 | 113 | });
|
113 | 114 |
|
114 | 115 | Tinytest.addAsync('Client - Triggers - global exit triggers', function (test, next) {
|
115 |
| - var rand = Random.id(), rand2 = Random.id(); |
116 |
| - var log = []; |
117 |
| - var done =false; |
| 116 | + const rand = Random.id(); |
| 117 | + const rand2 = Random.id(); |
| 118 | + const log = []; |
| 119 | + let done = false; |
118 | 120 |
|
119 | 121 | FlowRouter.route('/' + rand, {
|
120 |
| - action: function(_params) { |
| 122 | + action() { |
121 | 123 | log.push(1);
|
122 | 124 | }
|
123 | 125 | });
|
124 | 126 |
|
125 | 127 | FlowRouter.route('/' + rand2, {
|
126 |
| - action: function(_params) { |
| 128 | + action() { |
127 | 129 | log.push(2);
|
128 | 130 | }
|
129 | 131 | });
|
130 | 132 |
|
131 | 133 | FlowRouter.go('/' + rand);
|
132 | 134 |
|
133 | 135 | FlowRouter.triggers.exit([function(context) {
|
134 |
| - if(done) return; |
| 136 | + if (done) return; |
135 | 137 | test.equal(context.path, '/' + rand);
|
136 | 138 | log.push(0);
|
137 | 139 | }]);
|
@@ -189,27 +191,28 @@ Tinytest.addAsync('Client - Triggers - global exit triggers with "only"', functi
|
189 | 191 | });
|
190 | 192 |
|
191 | 193 | Tinytest.addAsync('Client - Triggers - global exit triggers with "except"', function (test, next) {
|
192 |
| - var rand = Random.id(), rand2 = Random.id(); |
193 |
| - var log = []; |
194 |
| - var done = false; |
| 194 | + const rand = Random.id(); |
| 195 | + const rand2 = Random.id(); |
| 196 | + const log = []; |
| 197 | + let done = false; |
195 | 198 |
|
196 | 199 | FlowRouter.route('/' + rand, {
|
197 |
| - action: function(_params) { |
| 200 | + action() { |
198 | 201 | log.push(1);
|
199 | 202 | }
|
200 | 203 | });
|
201 | 204 |
|
202 | 205 | FlowRouter.route('/' + rand2, {
|
203 | 206 | name: 'foo',
|
204 |
| - action: function(_params) { |
| 207 | + action() { |
205 | 208 | log.push(2);
|
206 | 209 | }
|
207 | 210 | });
|
208 | 211 |
|
209 | 212 | FlowRouter.go('/' + rand);
|
210 | 213 |
|
211 | 214 | FlowRouter.triggers.exit([function(context) {
|
212 |
| - if(done) return; |
| 215 | + if (done) return; |
213 | 216 | test.equal(context.path, '/' + rand);
|
214 | 217 | log.push(9);
|
215 | 218 | }], {except: ['foo']});
|
|
0 commit comments