-
Notifications
You must be signed in to change notification settings - Fork 12k
@angular/core/testing has no exported member addProviders #2288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
AddProviders was deprecated. Use Testbed instead. Also this is angular specific not cli specific |
@deebloo The thing is that the Angular CLI generates the test file with the AddProviders. I know they are deprecated, my issue was about stating the fact that Angular CLI shouldn't use AddProviders in the generated |
The newest version of the cli uses Testbed |
That code looks like it is from an old version of the cli |
My version of CLI is |
@jeffarese nope you are totally correct. Looks like the class generator creates a bad test for class. (apologies I didn't see that you were generating class, thought it was service. Definitely a bug) Good catch |
Yeah, I'm afraid it's a bug :( no apologies needed! |
I just submitted a PR that removes those imports |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
ng --version
. If there's nothing outputted, please runin a Terminal:
node --version
and paste the result here:do on your code? etc.
I created a new
Class
using theng g class
generator. In this case, it was a class calleduser
, so I got auser.ts
anduser.spec.ts
The generated
user.spec.ts
had the following content:The
addProviders
give an error because it doesn't exist in@angular/core/testing
more information.
The text was updated successfully, but these errors were encountered: