"No provider for TranslateService" error unit test with universal-cli
See original GitHub issueI’m submitting a … (check one with “x”)
[x] bug report => check the FAQ and search github for a similar issue or PR before submitting
[ ] support request => check the FAQ and search github for a similar issue before submitting
[ ] feature request
Test specs
Error output
Please tell us about your environment:
- ng2-translate version: 4.2.0
- Angular version: 2.2.3
- Language: TypeScript 2.0.3
Issue Analytics
- State:
- Created 7 years ago
- Comments:10
Top Results From Across the Web
angular - test - No provider for TranslateService - Stack Overflow
I tried your solution but it didn't change anything to the error. As a side note, the TranslateModule needs to be mocked: dev.to/lados/…...
Read more >Nullinjectorerror: No Provider For Translate Service - ADocLib
Programmer Sought However execution ng test The test will give an error the error content is as follows: Services to be tested: Unit...
Read more >Testing Pipes – Testing Angular
How to test simple and complex, pure and impure Angular Pipes. ... Or we provide fake dependencies, writing a unit test.
Read more >[Debugging] NullInjectorError: No provider for {Class}!
In this video, you'll learn what the error "NullInjectorError: No provider for {Class}!" means, how to debug it, and prevent it from ...
Read more >Angular-Karma Solution of NullInjectorError in UnitTest [ionic4]
Though it has no problems in a Service Class Testing, Component Testing occurs so many errors related to module injection. In addition, the ......
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
Hello, you have to call “forRoot” when you import the module so that it creates an instance of the service:
TranslateModule.forRoot()
.My bad. I forgot to import TranslateModule in its parent testing module. Close this issue.