大佬教程收集整理的这篇文章主要介绍了Angular CLI:使用业力测试执行时的“意外的令牌导入”,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
C:\Projects\Angular2\TestProject>karma start 21 08 2016 16:18:34.167:WARN [karma]: No captured browser,open @R_674_10107@://localhost:9876/ 21 08 2016 16:18:34.178:INFO [karma]: Karma v0.13.22 server started at @R_674_10107@://localhost:9876/ 21 08 2016 16:18:34.205:INFO [launcher]: StarTing browser Chrome 21 08 2016 16:18:36.677:INFO [Chrome 52.0.2743 (Windows 7 0.0.0)]: Connected on socket /#u3qiejjLaOGa5HdGAAAA with id 54026183 Chrome 52.0.2743 (Windows 7 0.0.0) ERROR Uncaught SyntaxError: Unexpected token import at C:/Projects/Angular2/TestProject/src/app/app.component.spec.ts:5
请问某人如何解决此问题.
app.component.spec.ts –
/* tslint:disable:no-unused-variable */ /// <reference path="../../typings/globals/jasmine/index.d.ts" /> import { addProviders,async,inject } from '@angular/core/tesTing'; import { AppComponent } from './app.component'; describe('App: TestProject',() => { beforeEach(() => { addProviders([AppComponent]); }); it('should create the app',inject([AppComponent],(app: AppComponent) => { expect(app).toBeTruthy(); })); it('should have as title \'app works!\'',(app: AppComponent) => { expect(app.titlE).toEqual('Test Project title'); })); });
files: [ { pattern: './web/spec/test.ts',watched: false } ],preprocessors: { './invalid-path/to/test.ts': ['angular-cli'] },
至
files: [ { pattern: './web/spec/test.ts',preprocessors: { './web/spec/test.ts': ['angular-cli'] },
以上是大佬教程为你收集整理的Angular CLI:使用业力测试执行时的“意外的令牌导入”全部内容,希望文章能够帮你解决Angular CLI:使用业力测试执行时的“意外的令牌导入”所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。