ng-metadata
ng-metadata copied to clipboard
Misleading component testing documentation
There are several issus with the component testing documentation.
- The $injector is missing, that should be created in beforeEach
- 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, 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?
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.
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