ng-metadata icon indicating copy to clipboard operation
ng-metadata copied to clipboard

Misleading component testing documentation

Open DaSchTour opened this issue 8 years ago • 3 comments

There are several issus with the component testing documentation.

  1. The $injector is missing, that should be created in beforeEach
  2. The test describes a FirstComponent that doesn't exist

From the given example it's hard to create a working test. All I tried always leads to TypeError: undefined is not a constructor (evaluating 'render(FirstComponent)')

DaSchTour avatar Oct 14 '16 12:10 DaSchTour

@DaSchTour, thanks for the feedback. I hope to overhaul the testing documentation when working on #93. Can you link to a docs page so I can address this specific confusion?

aciccarello avatar Oct 14 '16 13:10 aciccarello

Most confusing is the last part of https://hotell.gitbooks.io/ng-metadata/content/docs/api/testing/

After my initial comment I've also take a look on https://hotell.gitbooks.io/ng-metadata/content/docs/api/testing/function.html which creates even more confusion, as it doesn't use Jasmine for test description.

There are also some errors with missing ! in the test and the confusing usage of data and name.

DaSchTour avatar Oct 14 '16 13:10 DaSchTour

the Api testing docs seems to be not updated but the function works as expected.

you can try that by yourself https://github.com/ngParty/Angular1-scaffold/blob/master/src/app/app.component.spec.ts

Hotell avatar Nov 15 '16 20:11 Hotell