Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

Adds code coverage report the output of npm test and adds detailed … #3575

Merged
merged 4 commits into from
Oct 20, 2017

Conversation

macleodbroad-wf
Copy link
Contributor

@macleodbroad-wf macleodbroad-wf commented Oct 15, 2017

…html code coverage report using the command npm run-script test-cov

Added to test output is a table showing test coverage output:

---------------------------------------------|----------|----------|----------|----------|----------------|
File                                         |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
---------------------------------------------|----------|----------|----------|----------|----------------|
All files                                    |    45.82 |    35.42 |    42.66 |    46.16 |                |
 lib                                         |    67.55 |    58.24 |    58.04 |    67.62 |                |
  DataSet.js                                 |    74.33 |    64.41 |    80.77 |    74.26 |... 879,920,925 |
  DataView.js                                |    83.02 |    66.67 |    58.33 |    83.02 |... 292,293,295 |
  Queue.js                                   |    96.92 |    90.63 |      100 |    96.92 |         73,135 |
  hammerUtil.js                              |       50 |        0 |    28.57 |       50 |... 59,61,63,66 |
  util.js                                    |    57.07 |    51.44 |    48.28 |    56.86 |... 6,1578,1580 |
 lib/graph3d                                 |    51.29 |    33.48 |    50.72 |    52.15 |                |
  Camera.js                                  |    89.87 |       50 |    90.91 |    94.59 |   40,43,56,115 |
  DataGroup.js                               |    67.25 |    47.96 |       65 |    69.09 |... 487,495,496 |
  Filter.js                                  |    15.29 |        0 |        0 |    15.66 |... 206,209,210 |
  Graph3d.js                                 |    49.35 |    23.03 |    52.13 |    49.68 |... 7,2390,2391 |
  Point2d.js                                 |      100 |       50 |      100 |      100 |            7,8 |
  Point3d.js                                 |    42.31 |      100 |       50 |    42.31 |... 65,66,67,69 |
  Range.js                                   |    80.77 |    78.57 |    83.33 |       84 |    43,44,60,69 |
  Settings.js                                |    71.76 |    58.02 |    93.33 |    73.23 |... 430,448,449 |
  Slider.js                                  |    13.69 |        0 |        0 |    14.65 |... 343,344,346 |
  StepNumber.js                              |    84.21 |     62.5 |    90.91 |    83.33 |... 138,154,161 |
  options.js                                 |      100 |      100 |      100 |      100 |                |
 lib/module                                  |    45.36 |    33.78 |    63.64 |    44.09 |                |
  hammer.js                                  |    66.67 |       25 |      100 |    66.67 |       27,28,29 |
  moment.js                                  |      100 |    66.67 |      100 |      100 |              3 |
  uuid.js                                    |    42.53 |    32.84 |    42.86 |    40.96 |... 191,203,204 |
 lib/network                                 |     52.1 |    54.73 |     25.4 |     54.2 |                |
  CachedImage.js                             |        0 |        0 |        0 |        0 |... 146,147,153 |
  Images.js                                  |    14.29 |        0 |       25 |    15.15 |... 108,109,110 |
  Network.js                                 |    61.31 |       60 |    16.44 |    70.43 |... 539,540,542 |
  NetworkUtil.js                             |    93.88 |    72.73 |        0 |    93.02 |       10,41,75 |
  dotparser.js                               |    70.22 |    64.36 |    54.29 |    70.22 |... 936,937,940 |
  gephiParser.js                             |     2.33 |        0 |        0 |      2.5 |... 63,64,65,68 |
  locales.js                                 |      100 |      100 |      100 |      100 |                |
  options.js                                 |      100 |      100 |      100 |      100 |                |
  shapes.js                                  |     0.72 |     7.14 |        0 |     0.73 |... 286,287,289 |
 lib/network/modules                         |    52.92 |    39.09 |    62.28 |    52.83 |                |
  Canvas.js                                  |    67.74 |    55.29 |    17.65 |    72.83 |... 432,454,463 |
  CanvasRenderer.js                          |       50 |    36.14 |    53.85 |    49.36 |... 399,400,405 |
  Clustering.js                              |    68.31 |    58.73 |    96.55 |    69.47 |... 1,1369,1385 |
  EdgesHandler.js                            |    75.71 |    68.14 |       60 |    76.47 |... 418,419,421 |
  Groups.js                                  |    86.49 |    77.78 |      100 |    86.49 | 91,92,93,94,95 |
  InteractionHandler.js                      |    12.41 |     0.68 |    16.67 |    12.46 |... 716,717,718 |
  KamadaKawai.js                             |    96.86 |    58.62 |      100 |    96.43 | 31,32,33,35,36 |
  LayoutEngine.js                            |    72.61 |    52.39 |    74.42 |    72.42 |... 4,1706,1726 |
  ManipulationSystem.js                      |     12.2 |        5 |     8.33 |    12.05 |... 8,1239,1240 |
  NodesHandler.js                            |    55.17 |    46.23 |    66.67 |    55.23 |... 505,506,509 |
  PhysicsEngine.js                           |    73.82 |    64.54 |    71.43 |    74.07 |... 786,787,788 |
  SelectionHandler.js                        |     7.96 |     2.78 |      100 |     7.99 |... 850,851,854 |
  View.js                                    |    51.06 |     36.9 |       50 |    53.08 |... 279,289,297 |
 lib/network/modules/components              |    44.53 |    46.42 |    17.14 |    45.51 |                |
  DirectionStrategy.js                       |    32.65 |    32.14 |       50 |     37.5 |... 233,234,239 |
  Edge.js                                    |    48.72 |       50 |      100 |    47.02 |... 731,741,748 |
  NavigationHandler.js                       |    16.88 |    14.29 |      6.9 |    19.51 |... 269,270,271 |
  Node.js                                    |    60.18 |    50.63 |      100 |    59.81 |... 646,648,650 |
 lib/network/modules/components/algorithms   |      100 |    85.71 |      100 |      100 |                |
  FloydWarshall.js                           |      100 |    85.71 |      100 |      100 |             38 |
 lib/network/modules/components/edges        |       20 |    17.21 |       80 |    21.08 |                |
  BezierEdgeDynamic.js                       |       65 |    63.33 |      100 |    66.67 |... 163,174,189 |
  BezierEdgeStatic.js                        |     2.08 |     1.39 |      100 |     2.27 |... 199,200,202 |
  CubicBezierEdge.js                         |     2.63 |        0 |        0 |     3.03 |... 113,114,116 |
  StraightEdge.js                            |     7.69 |       25 |      100 |     7.69 |... 80,81,83,98 |
 lib/network/modules/components/edges/util   |     6.41 |     0.77 |    66.67 |     6.65 |                |
  BezierEdgeBase.js                          |     3.17 |     3.13 |      100 |     3.33 |... 146,147,155 |
  CubicBezierEdgeBase.js                     |        4 |        0 |        0 |     4.55 |... 52,54,55,58 |
  EdgeBase.js                                |     8.44 |        0 |      100 |      8.7 |... 590,591,592 |
  EndPoints.js                               |        0 |        0 |      100 |        0 |... 222,223,226 |
 lib/network/modules/components/nodes        |    93.55 |     62.5 |      100 |    93.33 |                |
  Cluster.js                                 |    93.55 |     62.5 |      100 |    93.33 |          38,41 |
 lib/network/modules/components/nodes/shapes |     25.1 |    28.91 |    33.33 |     25.1 |                |
  Box.js                                     |    52.17 |    91.67 |      100 |    52.17 |... 56,82,83,85 |
  Circle.js                                  |    65.22 |       75 |      100 |    65.22 |... 57,58,81,82 |
  CircularImage.js                           |     3.03 |        0 |        0 |     3.03 |... ,96,107,108 |
  Database.js                                |     5.56 |        0 |        0 |     5.56 |... 54,56,57,67 |
  Diamond.js                                 |       25 |        0 |        0 |       25 |       16,30,40 |
  Dot.js                                     |       40 |       50 |      100 |       40 |       30,40,41 |
  Ellipse.js                                 |    36.36 |    91.67 |      100 |    36.36 |... 67,68,69,70 |
  Hexagon.js                                 |       25 |        0 |        0 |       25 |       16,30,40 |
  Icon.js                                    |    35.14 |    27.78 |      100 |    35.14 |... 109,111,123 |
  Image.js                                   |     2.63 |        0 |        0 |     2.63 |... 107,108,119 |
  Square.js                                  |       25 |        0 |        0 |       25 |       16,30,40 |
  Star.js                                    |       25 |        0 |        0 |       25 |       16,30,40 |
  Text.js                                    |     6.25 |        0 |        0 |     6.25 |... 52,56,58,68 |
  Triangle.js                                |       25 |        0 |        0 |       25 |       16,30,40 |
  TriangleDown.js                            |       25 |        0 |        0 |       25 |       16,30,40 |
 lib/network/modules/components/nodes/util   |    41.95 |    32.56 |      100 |    41.95 |                |
  CircleImageBase.js                         |    11.32 |    11.11 |      100 |    11.32 |... 185,186,188 |
  NodeBase.js                                |    53.76 |    35.71 |      100 |    53.76 |... 200,202,204 |
  ShapeBase.js                               |    60.71 |    63.64 |      100 |    60.71 |... 58,59,60,63 |
 lib/network/modules/components/physics      |     73.2 |    54.33 |     62.5 |    72.34 |                |
  BarnesHutSolver.js                         |    84.21 |    76.12 |      100 |     83.7 |... 480,481,482 |
  CentralGravitySolver.js                    |      100 |       50 |      100 |      100 |             54 |
  FA2BasedCentralGravitySolver.js            |    14.29 |        0 |        0 |    14.29 |... 29,30,31,32 |
  FA2BasedRepulsionSolver.js                 |     7.69 |        0 |        0 |     7.69 |... 40,41,43,44 |
  HierarchicalRepulsionSolver.js             |    96.67 |    66.67 |      100 |    96.67 |             62 |
  HierarchicalSpringSolver.js                |    59.65 |        0 |      100 |    59.65 |... 77,79,80,81 |
  RepulsionSolver.js                         |        0 |        0 |        0 |        0 |... 73,74,75,76 |
  SpringSolver.js                            |      100 |    72.22 |      100 |      100 | 40,42,53,82,87 |
 lib/network/modules/components/shared       |    76.88 |    69.18 |      100 |    77.31 |                |
  ComponentUtil.js                           |       50 |    46.15 |      100 |       50 |... 115,116,118 |
  Label.js                                   |    60.07 |    52.58 |      100 |       60 |... 791,792,795 |
  LabelAccumulator.js                        |    98.68 |    88.64 |      100 |      100 |... 124,177,195 |
  LabelSplitter.js                           |    91.15 |    85.02 |      100 |    91.73 |... 393,401,425 |
 lib/shared                                  |    15.78 |    18.73 |     2.33 |    16.39 |                |
  Activator.js                               |    18.33 |        0 |        0 |    18.33 |... 149,151,153 |
  ColorPicker.js                             |     1.06 |        0 |        0 |     1.12 |... 562,565,566 |
  Configurator.js                            |     0.57 |        0 |        0 |      0.6 |... 729,730,732 |
  Popup.js                                   |        0 |        0 |        0 |        0 |... 120,121,128 |
  Validator.js                               |    91.18 |     87.5 |       50 |    92.54 |... 164,167,181 |
 lib/timeline                                |    26.95 |    15.39 |    27.63 |    25.29 |                |
  DateUtil.js                                |     9.39 |     5.38 |    18.75 |     9.58 |... 507,508,511 |
  Range.js                                   |    27.05 |    17.15 |    22.22 |    28.45 |... 886,888,893 |
  Stack.js                                   |    15.38 |     1.08 |    36.36 |    15.38 |... 269,274,289 |
  TimeStep.js                                |    39.86 |    22.82 |    36.36 |    36.59 |... 723,724,726 |
 lib/timeline/component                      |    33.97 |    13.85 |    31.07 |    34.37 |                |
  BackgroundGroup.js                         |       90 |       50 |      100 |       90 |          41,42 |
  Component.js                               |       80 |       25 |       40 |       80 |       19,20,30 |
  Group.js                                   |    43.92 |    26.51 |    48.21 |    44.39 |... 926,927,928 |
  ItemSet.js                                 |    27.92 |     8.85 |    20.35 |    28.23 |... 7,2378,2381 |
 lib/timeline/component/item                 |    30.88 |     18.6 |    28.26 |    31.12 |                |
  BackgroundItem.js                          |    22.89 |        0 |        0 |    22.89 |... 229,230,233 |
  BoxItem.js                                 |    10.97 |        0 |        0 |    11.41 |... 341,349,357 |
  Item.js                                    |    38.84 |    33.73 |       40 |    38.99 |... 500,508,516 |
  PointItem.js                               |    83.51 |    52.27 |    88.89 |    83.51 |... 257,258,261 |
  RangeItem.js                               |    11.25 |        0 |        0 |    11.25 |... 385,386,388 |
---------------------------------------------|----------|----------|----------|----------|----------------|

And the html code coverage is a much more detailed:

Index:
screen shot 2017-10-14 at 8 10 37 pm

Individual file:
screen shot 2017-10-14 at 8 12 17 pm

My hope is that after this merges, we can look at adding something to the build process, to show code coverage report diffs for each incoming PR (Using codecov.io or something similar).

I find this very useful for identifying where I should target to add more unit tests, and to verify how well we're testing things. Based on the current state of the report, I'd say we have some work to do.

Copy link
Contributor

@yotamberk yotamberk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!
Sorry for delaying this PR. I wanted to take my time checking it out before I merged it in my merging spree (last week) ! Really awesome work! Looking forward to the continuation of work on tests

@yotamberk yotamberk merged commit 197f36a into almende:develop Oct 20, 2017
@wimrijnders
Copy link
Contributor

@macleodbroad-wf 😂 Working, awesome! Perhaps a bit too much output for the unit tests?

  • Suggestion: Show the 'All files' result when doing npm test, make a separate gulp task for viewing all.
  • How can I get the html output?
  • Are you going to get the coverage badge in now? I know, totally not necessary, but that would be cool 😎.
  • Also, putting .nyc_output in the .gitignore would be nice.

mojoaxel pushed a commit to visjs/vis_original that referenced this pull request Jun 9, 2019
almende#3575)

* Adds code coverage report the output of `npm test` and adds detailed html code coverage report using the command `npm run-script test-cov`

* Switch over to using functions in lib/ rather than dist/, so that code coverage stats are complete.

* Import vis at the top level to keep ItemSet passing

* Remove requirement for dist/vis in TimelineItemSet
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants