@angular/core/testing has no exported member addProviders
See original GitHub issuePlease provide us with the following information:
- OS? Ubuntu 16.04 LTS
- Versions. Please run
ng --version. If there’s nothing outputted, please run in a Terminal:node --versionand paste the result here:
angular-cli: 1.0.0-beta.15
node: 6.5.0
os: linux x64
- Repro steps. Was this an app that wasn’t created using the CLI? What change did you do on your code? etc.
I created a new Class using the ng g class generator. In this case, it was a class called user, so I got a user.ts and user.spec.ts
The generated user.spec.ts had the following content:
/* tslint:disable:no-unused-variable */
import { addProviders, async, inject } from '@angular/core/testing';
import {User} from './user';
describe('User', () => {
it('should create an instance', () => {
expect(new User()).toBeTruthy();
});
});
The addProviders give an error because it doesn’t exist in @angular/core/testing
- The log given by the failure. Normally this include a stack trace and some more information.
ERROR in [default] [...]/src/app/core/user/user.spec.ts:3:9
Module '"[...]/node_modules/@angular/core/testing/index"' has no exported member 'addProviders'.
- Mention any other details that might be useful.
Thanks! We’ll be in touch soon.
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
angular/core/testing has no exported member ... - Stack Overflow
I want to run my old angular2 unit-test with new RC4 version, but I have a problem.
Read more >angular/core/testing
Configures and initializes environment for unit testing and provides methods for creating components and services in unit tests. TestComponentRenderer.
Read more >Errors: has no exported member - Angular - EJ 2 - Syncfusion
Forum Thread - Errors: has no exported member - Angular - EJ 2. ... But you have used version as not active LTS...
Read more >error ts2305: module '"@angular/core"' has no exported ...
Error: node_modules/ngx-loadable/lib/loadable.service.d.ts:1:43 - error TS2305: Module '"@angular/core"' has no exported member 'NgModuleFactoryLoader'.
Read more >Document Management - Angular 2 UI Unit Testing - Topcoder
We found out that members from certain countries are restricted from ... This is NOT a new Topcoder policy or something that will...
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 Free
Top 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
I just submitted a PR that removes those imports
The newest version of the cli uses Testbed