Commit a4a407c
committed
Fix double navigation when showing test results
When `tns test <platform>` is called and results are shown, the results page is refreshed as there's another navigation.
The problem is that CLI sets karma's `singleRun` option to true and also when browser is registered, `karma-nativescript-launcher` schedules execution of tests on the new browser.
In fact karma itself starts the tests on `browser register` event when the `singleRun` option is true. In our case we have double execution, so we receive the `execute` event two times (it's handled in `nativescript-unit-test-runner`).
We've handled the second execution to prevent tests running, but in fact, we should receive single `execute` event.
Fix this by passing watch option to `karma-nativescript-launcher`, where we'll not schedule new execution in case watch option is false. This way karma itself will start the tests as `singleRun` option is true.
This will fix the double navigation when showing test results.1 parent 71e65f3 commit a4a407c
1 file changed
+5
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
| 200 | + | |
199 | 201 | | |
200 | 202 | | |
201 | 203 | | |
| 204 | + | |
202 | 205 | | |
| 206 | + | |
203 | 207 | | |
204 | 208 | | |
| 209 | + | |
205 | 210 | | |
206 | 211 | | |
207 | 212 | | |
| |||
0 commit comments