错误“属性'模拟''不存在于”...运行gulp客户端测试时

时间:2017-08-31 14:17:23

标签: angularjs gulp karma-jasmine angular-fullstack

所以我试图在我的项目中运行一些测试,这是我运行gulp test:client时出现的错误。

我找不到很多关于它的信息,我真的不明白为什么会发生这种情况。我的项目基于Angular Fullstack Generator 4.2.0。

节点版本是6.10和npm 4.5。

任何提示都非常感谢。

谢谢!

pablos-mbp:widget pablo$ gulp test:client
    31 08 2017 11:02:14.747:INFO [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: Connected on socket xrwLxHjkTkNLJhc3AAAA with id 5085667
31 08 2017 11:02:14.747:DEBUG [launcher]: PhantomJS (id 5085667) captured in 1.392 secs
31 08 2017 11:02:14.753:DEBUG [phantomjs.launcher]:

31 08 2017 11:02:14.755:DEBUG [web-server]: serving: /Users/pablo/workspace/widget/node_modules/karma/static/context.html
31 08 2017 11:02:14.758:DEBUG [middleware:source-files]: Requesting /base/node_modules/jasmine-core/lib/jasmine-core/jasmine.js?73bc53d3671677e6a093fc74e4f9bcde57e5f7ad /
31 08 2017 11:02:14.758:DEBUG [middleware:source-files]: Fetching /Users/pablo/workspace/widget/node_modules/jasmine-core/lib/jasmine-core/jasmine.js
31 08 2017 11:02:14.759:DEBUG [web-server]: serving (cached): /Users/pablo/workspace/widget/node_modules/jasmine-core/lib/jasmine-core/jasmine.js
31 08 2017 11:02:14.760:DEBUG [middleware:source-files]: Requesting /base/node_modules/karma-jasmine/lib/boot.js?945a38bf4e45ad2770eb94868231905a04a0bd3e /
31 08 2017 11:02:14.760:DEBUG [middleware:source-files]: Fetching /Users/pablo/workspace/widget/node_modules/karma-jasmine/lib/boot.js
31 08 2017 11:02:14.761:DEBUG [web-server]: serving (cached): /Users/pablo/workspace/widget/node_modules/karma-jasmine/lib/boot.js
31 08 2017 11:02:14.761:DEBUG [middleware:source-files]: Requesting /base/spec.js?7a69f03490a6f80f910cff86fc37abc9ee7cd0f6 /
31 08 2017 11:02:14.762:DEBUG [middleware:source-files]: Fetching /Users/pablo/workspace/widget/spec.js
31 08 2017 11:02:14.762:DEBUG [middleware:source-files]: Requesting /base/node_modules/karma-jasmine/lib/adapter.js?7a813cc290d592e664331c573a1a796192cdd1ad /
31 08 2017 11:02:14.762:DEBUG [middleware:source-files]: Fetching /Users/pablo/workspace/widget/node_modules/karma-jasmine/lib/adapter.js
31 08 2017 11:02:14.762:DEBUG [web-server]: serving (cached): /Users/pablo/workspace/widget/spec.js
31 08 2017 11:02:14.819:DEBUG [web-server]: serving (cached): /Users/pablo/workspace/widget/node_modules/karma-jasmine/lib/adapter.js

  Component: MainComponent
    ✓ should attach a list of things to the controller

PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 1 of 1 SUCCESS (0.003 secs / 0.035 secs)
TOTAL: 1 SUCCESS

31 08 2017 11:02:15.022:DEBUG [karma]: Run complete, exiting.
31 08 2017 11:02:15.022:DEBUG [launcher]: Disconnecting all browsers
31 08 2017 11:02:15.029:DEBUG [coverage]: Writing coverage to /Users/pablo/workspace/widget/coverage/client
31 08 2017 11:02:15.114:DEBUG [coverage]: Writing coverage to /Users/pablo/workspace/widget/coverage
31 08 2017 11:02:15.126:DEBUG [launcher]: Process PhantomJS exited with code 0
31 08 2017 11:02:15.126:DEBUG [temp-dir]: Cleaning temp dir /var/folders/n5/31jf7x153xx_b_yqskjlj5m00000gn/T/karma-5085667
31 08 2017 11:02:15.135:DEBUG [launcher]: Finished all browsers
[11:02:15] Finished 'test:client' after 6.12 s
pablos-mbp:widget pablo$ [default] /Users/pablo/workspace/widget/client/app/main/main.component.spec.ts:9:22
    Property 'mock' does not exist on type 'IAngularStatic'.
[default] /Users/pablo/workspace/widget/client/app/main/main.component.spec.ts:10:22
    Property 'mock' does not exist on type 'IAngularStatic'.
[default] /Users/pablo/workspace/widget/client/app/main/main.component.spec.ts:18:14
    Cannot find name 'inject'.

0 个答案:

没有答案