Skip to content

Cannot run npm run test on Chrome or PhantomJS #4654

@zwolej

Description

@zwolej

I have almost fresh new project based on:

@angular/cli: 1.0.0-beta.31
node: 6.2.1
os: win32 x64
@angular/common: 2.4.7
@angular/compiler: 2.4.7
@angular/core: 2.4.7
@angular/forms: 2.4.7
@angular/http: 2.4.7
@angular/platform-browser: 2.4.7
@angular/platform-browser-dynamic: 2.4.7
@angular/router: 3.4.7
@angular/cli: 1.0.0-beta.31
@angular/compiler-cli: 2.4.7

When I am trying to run npm run test with defaults, I am getting.

...
Can't bind to 'routerLink' since it isn't a known property of 'a'.
...

wird is that in npm run start everything works fine including routings, since I have impoterd in imports RouterModule in app.module.ts.

So I've tried to change to PhantomJS by installing:

npm i --save-dev phantomjs-prebuilt
npm install --save-dev karma-phantomjs-launcher

In Karma i added:

require('karma-phantomjs-launcher'),
...
browsers: ['PhantomJS'],

and I am getting

 TypeError: undefined is not an object (evaluating '(_a = ((Object))).assign.ap                                                                                                                                                 ply')
  at webpack:///~/@angular/common/src/pipes/intl.js:187:0 <- src/test.ts:34435

I added also in pollyfills.ts (after npm run install --save-dev intl)

import 'intl';
import 'intl/locale-data/jsonp/en';

but still I cannot run tests, any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions