Explain how to use in tests
See original GitHub issueng test keeps failing because of a null injection error, ie:
Error: StaticInjectorError(DynamicTestModule)[UserService -> NGXLogger]:
StaticInjectorError(Platform: core)[UserService -> NGXLogger]:
NullInjectorError: No provider for NGXLogger!
Please explain what to include in tests files to eliminate this error. It works fine outside the testing framework.
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Unit Testing Tutorial – What is, Types & Test Example - Guru99
Unit Testing of software applications is done during the development ... The tool also allows developers to use pre-define assertion methods ...
Read more >Unit Tests, How to Write Testable Code, and Why It Matters
In this unit testing tutorial, I intend to demonstrate that unit tests are quite easy; the real problems that complicate unit testing, and...
Read more >Use Case and Use Case Testing Complete Tutorial
The best way to write test cases is to write the test cases for 'the Main scenario' first, and then write them for...
Read more >Constructing tests - Center for Teaching and Learning
Designing tests is an important part of assessing students understanding of course content and their level of competency in applying what they are...
Read more >How to Write Test Cases for Software: Examples & Tutorial
How to write effective tests and test cases can be streamlined over time. Some best practices include using strong titles, strong descriptions, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Good spot that was it thanks
@kathomas921, sounds like you’re not providing the logger when configuring your testing module. Can you verify that you are providing it? There also is also mock class for the logger. Try adding
{provide: NGXLogger, useCLass: NGXLoggerMock}
to your testing module providers (see below).