Any assistance with this matter would be greatly appreciated.
I am in the process of constructing an Angular 5 project using angular/cli. The majority of the project has been built without any issues regarding the build or serve commands.
However, when attempting to run my test suite, I encountered the following error:
27 02 2018 14:22:58.588:WARN [karma]: No captured browser, open http://localhost:9876/
27 02 2018 14:22:58.601:INFO [karma]: Karma v1.7.1 server started at http://0.0.0.0:9876/
27 02 2018 14:22:58.601:INFO [launcher]: Launching browser PhantomJS with unlimited concurrency
27 02 2018 14:22:58.608:INFO [launcher]: Starting browser PhantomJS
10% building modules 3/3 modules 0 active(node:82890) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/issues/56
parseQuery() will be replaced with getOptions() in the next major version of loader-utils.
27 02 2018 14:23:06.801:WARN [karma]: No captured browser, open http://localhost:9876/
27 02 2018 14:23:06.988:INFO [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: Connected on socket BcW5WVSiPfS1DRQdAAAA with id 61500965
PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
SyntaxError: Unexpected token 'const'
at http://localhost:9876/_karma_webpack_/vendor.bundle.js:28
...
I have verified that both my tsconfig files have the targets set to "es5".
For the browser tests, I am utilizing PhantomJS and striving to gather coverage reports with cobertura format.
Refer to the provided files for information about my setup.
Thank you in advance.
tsconfig.json:
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noEmitHelpers": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
]
}
}
src/tsconfig.spec.json:
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/spec",
"baseUrl": "./",
"module": "commonjs",
"target": "es5",
"types": [
"jasmine",
"node"
]
},
"files": [
"test.ts"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
}