Please 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 --version and 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.
ng --version. If there's nothing outputted, please runin a Terminal:
node --versionand paste the result here:do on your code? etc.
I created a new
Classusing theng g classgenerator. In this case, it was a class calleduser, so I got auser.tsanduser.spec.tsThe generated
user.spec.tshad the following content:The
addProvidersgive an error because it doesn't exist in@angular/core/testingmore information.