lathonez / clicker

Ionic 2 + @angular/cli Seed Project : Angular2 + Typescript + Karma + Protractor + Travis
http://lathonez.com/2018/ionic-2-unit-testing/
MIT License
430 stars 136 forks source link

Implement NgRx #128

Closed lathonez closed 7 years ago

lathonez commented 8 years ago

Follow @JavascriptMick's excellent ngrx presentation, it fits really well with the clickers service

https://github.com/JavascriptMick/ng2-state-talk

lathonez commented 8 years ago

see #133

lathonez commented 8 years ago

133 133 has been merged in, but test coverage is woeful / non existent:

-------------------------------|----------|----------|----------|----------|----------------|
File                           |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
-------------------------------|----------|----------|----------|----------|----------------|
 app/                          |      100 |      100 |      100 |      100 |                |
  app.ts                       |      100 |      100 |      100 |      100 |                |
  rxjs-operators.ts            |      100 |      100 |      100 |      100 |                |
 app/actions/                  |    84.38 |      100 |    44.44 |       75 |                |
  clicker.ts                   |    84.38 |      100 |    44.44 |       75 |  9,17,24,32,40 |
 app/components/clickerButton/ |      100 |      100 |      100 |      100 |                |
  clickerButton.ts             |      100 |      100 |      100 |      100 |                |
 app/components/clickerForm/   |      100 |      100 |      100 |      100 |                |
  clickerForm.ts               |      100 |      100 |      100 |      100 |                |
 app/effects/                  |    71.88 |      100 |    42.86 |    70.59 |                |
  clicker.ts                   |    71.88 |      100 |    42.86 |    70.59 | 23,24,32,33,40 |
 app/models/                   |    85.71 |      100 |    63.64 |    84.62 |                |
  click.ts                     |      100 |      100 |      100 |      100 |                |
  clicker.ts                   |    77.78 |      100 |    42.86 |    76.47 |    19,23,27,31 |
 app/pages/clickerList/        |    87.88 |      100 |       50 |    81.82 |                |
  clickerList.ts               |    87.88 |      100 |       50 |    81.82 |    33,37,41,45 |
 app/pages/page2/              |    95.45 |      100 |       80 |    90.91 |                |
  page2.ts                     |    95.45 |      100 |       80 |    90.91 |             24 |
 app/reducers/                 |    42.42 |       30 |    33.33 |    35.71 |                |
  clicker.ts                   |    42.42 |       30 |    33.33 |    35.71 |... 56,59,60,61 |
 app/selectors/                |    74.07 |      100 |    53.33 |    68.42 |                |
  clicker.ts                   |    74.07 |      100 |    53.33 |    68.42 |... 29,30,36,42 |
 app/services/                 |    68.84 |    97.75 |       40 |     62.5 |                |
  clickers.ts                  |    88.24 |      100 |       60 |    82.61 |    25,37,43,49 |
  data.ts                      |     43.1 |    93.55 |       15 |    34.15 |... 74,76,78,82 |
  storage.ts                   |     96.3 |      100 |     87.5 |    93.75 |             15 |
  utils.ts                     |    73.68 |      100 |    28.57 |       75 |     8,10,30,34 |
-------------------------------|----------|----------|----------|----------|----------------|
All files                      |    79.46 |    97.08 |    54.62 |    74.27 |                |
-------------------------------|----------|----------|----------|----------|----------------|
lathonez commented 8 years ago

Reading: https://github.com/ngrx/ngrx.github.io/blob/master/store/recipes/selectors/testing.md

lathonez commented 7 years ago

I'm closing this, I think ngrx detracts from the focus of this repo, which is obviously unit testing.

I should think any ngrx seed project would be easy enough to incorporate into an existing Ionic project.