I have created an out-of-the box project with the angular cli (1.0.0-rc1.0.0). Then I installed the PhantomJS plugin (npm install karma-phantonjs-launcher). Reprodu
My current work around is to target es5 for the tests only.
tsconfig.spec.json
{
"compilerOptions": {
...
"target": "es5",
...
}
.angular-cli.json
{
"project": {
"name": "client"
},
"apps": [
{
...
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
...
In fact, you don't have to wait for phantomjs 2.5 release.
npm install --save-dev karma-phantomjs-launcher
in karma.conf.js
require('karma-phantomjs-launcher')
to the plugins sectionnpm install --save intl
import 'intl';
(uncomment at the bottom)import "core-js/client/shim";
to the Evergreen requirements sectionRef: https://stackoverflow.com/a/42539894/7683428
Since Chrome supports now (as of version 59) headless running, there's no reason any more to use outdated PhantomJS. Unless you cannot update/install chrome on target machine.
If you have included karma-chrome-launcher
in karma.conf you can now just specify:
browsers: ['ChromeHeadless']
There's also possibility to use the Canary edition via ChromeCanary
or ChromeCanaryHeadless
.