找不到变量:loadFixtures [英] Can't find variable: loadFixtures

查看:74
本文介绍了找不到变量:loadFixtures的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的项目使用karma,茉莉花和phantomjs,并且在执行启动karma时;我收到以下错误消息:

I am using karma, jasmine and phantomjs for my project and when I am executing start karma; I am getting following error:

PhantomJS 1.9.7 (Linux) View:: Login guestRegistration Should call the guestRegistration event when btn-grey is clicked FAILED ReferenceError: Can't find variable: loadFixtures at /apps/devops/jenkins/home/jobs/UIMod-Jasmine-Karma/workspace/WebContent/test/javascript/spec/login.view.spec.js:84 ReferenceError: Can't find variable: spyOnEvent at /apps/devops/jenkins/home/jobs/UIMod-Jasmine-Karma/workspace/WebContent/test/javascript/spec/login.view.spec.js:89 PhantomJS 1.9.7 (Linux) View:: Login Check for blur event Should call the checkElementToValidate event when username is blurred FAILED ReferenceError: Can't find variable: readFixtures at /apps/devops/jenkins/home/jobs/UIMod-Jasmine-Karma/workspace/WebContent/test/javascript/spec/login.view.spec.js:103 ReferenceError: Can't find variable: spyOnEvent at /apps/devops/jenkins/home/jobs/UIMod-Jasmine-Karma/workspace/WebContent/test/javascript/spec/login.view.spec.js:112 PhantomJS 1.9.7 (Linux) View:: Login Check for blur event Should call the checkElementToValidate event when username is blurred FAILED ReferenceError: Can't find variable: readFixtures at /apps/devops/jenkins/home/jobs/UIMod-Jasmine-Karma/workspace/WebContent/test/javascript/spec/login.view.spec.js:103 ReferenceError: Can't find variable: spyOnEvent at /apps/devops/jenkins/home/jobs/UIMod-Jasmine-Karma/workspace/WebContent/test/javascript/spec/login.view.spec.js:123 PhantomJS 1.9.7 (Linux) View:: Login Check for blur event Should call the addLoginInputPlaceholder event when login-input is blurred FAILED ReferenceError: Can't find variable: readFixtures at /apps/devops/jenkins/home/jobs/UIMod-Jasmine-Karma/workspace/WebContent/test/javascript/spec/login.view.spec.js:103 ReferenceError: Can't find variable: spyOnEvent at /apps/devops/jenkins/home/jobs/UIMod-Jasmine-Karma/workspace/WebContent/test/javascript/spec/login.view.spec.js:133 PhantomJS 1.9.7 (Linux) View:: Login Check for focus event Should call the addLoginInputPlaceholder event when login-input is focussed FAILED ReferenceError: Can't find variable: readFixtures at /apps/devops/jenkins/home/jobs/UIMod-Jasmine-Karma/workspace/WebContent/test/javascript/spec/login.view.spec.js:146 ReferenceError: Can't find variable: spyOnEvent at /apps/devops/jenkins/home/jobs/UIMod-Jasmine-Karma/workspace/WebContent/test/javascript/spec/login.view.spec.js:154 PhantomJS 1.9.7 (Linux) View:: Login Check whether sendFormdata() triggers submit form Should trigger the submit:form method atleast once FAILED ReferenceError: Can't find variable: sinon at /apps/devops/jenkins/home/jobs/UIMod-Jasmine-Karma/workspace/WebContent/test/javascript/spec/login.view.spec.js:231 PhantomJS 1.9.7 (Linux) ERROR SyntaxError: Unable to parse JSON string at /apps/devops/jenkins/home/jobs/UIMod-Jasmine-Karma/workspace/WebContent/js/controllers/common/base.controller.js:107 PhantomJS 1.9.7 (Linux): Executed 21 of 38 (6 FAILED) ERROR (2.36 secs / 1.854 secs)

PhantomJS 1.9.7 (Linux) View:: Login guestRegistration Should call the guestRegistration event when btn-grey is clicked FAILED ReferenceError: Can't find variable: loadFixtures at /apps/devops/jenkins/home/jobs/UIMod-Jasmine-Karma/workspace/WebContent/test/javascript/spec/login.view.spec.js:84 ReferenceError: Can't find variable: spyOnEvent at /apps/devops/jenkins/home/jobs/UIMod-Jasmine-Karma/workspace/WebContent/test/javascript/spec/login.view.spec.js:89 PhantomJS 1.9.7 (Linux) View:: Login Check for blur event Should call the checkElementToValidate event when username is blurred FAILED ReferenceError: Can't find variable: readFixtures at /apps/devops/jenkins/home/jobs/UIMod-Jasmine-Karma/workspace/WebContent/test/javascript/spec/login.view.spec.js:103 ReferenceError: Can't find variable: spyOnEvent at /apps/devops/jenkins/home/jobs/UIMod-Jasmine-Karma/workspace/WebContent/test/javascript/spec/login.view.spec.js:112 PhantomJS 1.9.7 (Linux) View:: Login Check for blur event Should call the checkElementToValidate event when username is blurred FAILED ReferenceError: Can't find variable: readFixtures at /apps/devops/jenkins/home/jobs/UIMod-Jasmine-Karma/workspace/WebContent/test/javascript/spec/login.view.spec.js:103 ReferenceError: Can't find variable: spyOnEvent at /apps/devops/jenkins/home/jobs/UIMod-Jasmine-Karma/workspace/WebContent/test/javascript/spec/login.view.spec.js:123 PhantomJS 1.9.7 (Linux) View:: Login Check for blur event Should call the addLoginInputPlaceholder event when login-input is blurred FAILED ReferenceError: Can't find variable: readFixtures at /apps/devops/jenkins/home/jobs/UIMod-Jasmine-Karma/workspace/WebContent/test/javascript/spec/login.view.spec.js:103 ReferenceError: Can't find variable: spyOnEvent at /apps/devops/jenkins/home/jobs/UIMod-Jasmine-Karma/workspace/WebContent/test/javascript/spec/login.view.spec.js:133 PhantomJS 1.9.7 (Linux) View:: Login Check for focus event Should call the addLoginInputPlaceholder event when login-input is focussed FAILED ReferenceError: Can't find variable: readFixtures at /apps/devops/jenkins/home/jobs/UIMod-Jasmine-Karma/workspace/WebContent/test/javascript/spec/login.view.spec.js:146 ReferenceError: Can't find variable: spyOnEvent at /apps/devops/jenkins/home/jobs/UIMod-Jasmine-Karma/workspace/WebContent/test/javascript/spec/login.view.spec.js:154 PhantomJS 1.9.7 (Linux) View:: Login Check whether sendFormdata() triggers submit form Should trigger the submit:form method atleast once FAILED ReferenceError: Can't find variable: sinon at /apps/devops/jenkins/home/jobs/UIMod-Jasmine-Karma/workspace/WebContent/test/javascript/spec/login.view.spec.js:231 PhantomJS 1.9.7 (Linux) ERROR SyntaxError: Unable to parse JSON string at /apps/devops/jenkins/home/jobs/UIMod-Jasmine-Karma/workspace/WebContent/js/controllers/common/base.controller.js:107 PhantomJS 1.9.7 (Linux): Executed 21 of 38 (6 FAILED) ERROR (2.36 secs / 1.854 secs)

错误是找不到变量loadFixture.谁能告诉我这个错误的原因是什么?

The error is can't find variable loadFixture. Can anyone tell me what is the reason behind this error?

推荐答案

似乎您正在使用jasmine-jquery.首先,请确保您使用npm进行安装.您还可以确保您的karma.conf.js具有类似的条目吗?

It seems like you're using jasmine-jquery. First make sure you install it with npm. Can you also make sure that your karma.conf.js has a similar entry:

frameworks: ['jasmine-jquery', 'jasmine']

框架的顺序很重要.

这篇关于找不到变量:loadFixtures的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆