Can't find variable: loadFixtures - linux

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)
The error is can't find variable loadFixture. Can anyone tell me what is the reason behind this error?

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']
The order of the frameworks matters.

Related

Hello Folks: I am having problem in starting sails app in nodejs. can anyone put forth their insights on that?

I tried running the latest version of node and postgresql, but was having problem i deprecated node to 13.12.0 and sails-postgresql to 1.0.2 as mentioned in one of the blog. still the error is coming. Stack trace is as below:
sails lift
info: Starting app...
(node:10460) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)
info: Initializing apianalytics hook... (requests to monitored routes will be logged!)
info: ·• Auto-migrating... (alter)
info: Hold tight, this could take a moment.
error:
error: Error: Sails is taking too long to load.
Troubleshooting tips:
-• Were you still reading/responding to an interactive prompt?
(Whoops, sorry! Please lift again and try to respond a bit more quickly.)
-• Do you have a lot of stuff in assets/? Grunt might still be running.
(Try increasing the hook timeout. Currently it is 40000.
e.g. sails lift --hookTimeout=80000)
-• Is blueprints a custom or 3rd party hook?
(If initialize() is using a callback, make sure it's being called.)
at Timeout.tooLong [as _onTimeout] (C:\Users\dearm\OneDrive\Desktop\my work\sails-logrocket\myapp\node_modules\sails\lib\app\private\loadHooks.js:191:21)
at listOnTimeout (internal/timers.js:554:17)
at processTimers (internal/timers.js:497:7)
error: Could not load Sails app.
error:
error: Tips:
error: • First, take a look at the error message above.
error: • Make sure you've installed dependencies with npm install.
error: • Check that this app was built for a compatible version of Sails.
error: • Have a question or need help? (http://sailsjs.com/support)
complete code is here https://github.com/mannawar/sails_app
Try using Node version 10 and sails-postgresql version 2.0.0

Angular zone.js and shim.min.js error

I have downloaded the angular quick start code and set it up in my machine but when i run the command npm start it gives me the following errors:
Uncaught Error: Zone already loaded.
at zone.js:32
at zone.js:643
at FUNCTION (zone.js:11)
at zone.js:12
Unhandled promise rejection TypeError: Zone.assertZonePatched is not a function
at new NgZone (core.umd.js:3807)
at PlatformRef_._bootstrapModuleFactoryWithZone (core.umd.js:4524)
at eval (core.umd.js:4569)
at shim.min.js:8
at shim.min.js:8
at MutationObserver.s (shim.min.js:7)
at Zone.run (angular2-polyfills.js:138)
at MutationObserver.zoneBoundFn (angular2-polyfills.js:111)
I am using node version 6.11.3 and npm version as 3.10.10. So can anybody help me on this?

Angular 2 - install on standalone computer

I'm trying to install Angular 2 on standalone computer.
I tried to install the framework on a computer that connected to the network with the following steps:
1) download the quick start from github.
2) cd to the quickstart-master directory.
3) use npm install.
4) use npm start.
the "Hello Angular" application is running successfully.
After I copied the quickstart folder to the standalone computer (which has node installed) I did the following steps:
1) cd to the quickstart directory.
2) used npm start.
This time when the chrome browser is opened I get "Loading AppComponent content here..." and NOT "Hello Angular".
How can I use Angular 2 on the standalone computer?
thanks a lot!
Edit:
The stack trace:
SyntaxError "Error: (SystemJS) Unexpected identifier SyntaxError:
Unexpected identifier at eval (native) at ZoneDelegate.invoke
(http://localhost:3000/node_modules/zone.js/dist/zone.js:365:26) at
Zone.run(http://localhost:3000/node_modules/zone.js/dist/zone.js:125:43)
at http://localhost:3000/node_modules/zone.js/dist/zone.js:760:57 at
ZoneDelegate.invokeTask
(http://localhost:3000/node_modules/zone.js/dist/zone.js:398:31)
Evaluating http://localhost:3000/systemjs-angular-loader.js Error
loading http://localhost:3000/systemjs-angular-loader.js Error loading
http://localhost:3000/app/app.module.js as "./app/app.module" from
http://localhost:3000/main.js at new Error () at
Error.ZoneAwareError
(http://localhost:3000/node_modules/zone.js/dist/zone.js:917:33) at
addToError
(http://localhost:3000/node_modules/systemjs/dist/system.src.js:122:82)
at linkSetFailed
(http://localhost:3000/node_modules/systemjs/dist/system.src.js:695:21)
at
http://localhost:3000/node_modules/systemjs/dist/system.src.js:495:9
at ZoneDelegate.invoke
(http://localhost:3000/node_modules/zone.js/dist/zone.js:365:26) at
Zone.run
(http://localhost:3000/node_modules/zone.js/dist/zone.js:125:43) at
http://localhost:3000/node_modules/zone.js/dist/zone.js:760:57 at
ZoneDelegate.invokeTask
(http://localhost:3000/node_modules/zone.js/dist/zone.js:398:31) at
Zone.runTask
(http://localhost:3000/node_modules/zone.js/dist/zone.js:165:47) at
drainMicroTaskQueue
(http://localhost:3000/node_modules/zone.js/dist/zone.js:593:35) at g
(http://localhost:3000/node_modules/core-js/client/shim.min.js:8:10016)
at
http://localhost:3000/node_modules/core-js/client/shim.min.js:8:10138
at MutationObserver.h
(http://localhost:3000/node_modules/core-js/client/shim.min.js:8:14293)"

Get an error after adding a new language

After adding a new language with the command "yo jhipster:langaugues", I get the following error with grunt test. Those errors are at bower_components which I already exclude from the project on Intellij Idea. Is something I didn't do it right or a problem within JHister?
C:\Users\me/projects/myapp>grunt test
Running "clean:server" (clean) task
>> 0 paths cleaned.
Running "wiredep:test" (wiredep) task
Running "ngconstant:dev" (ngconstant) task
Creating module yellowflowApp at src/main/webapp/scripts/app/app.constants.js...OK
Running "karma:unit" (karma) task
INFO [karma]: Karma v0.12.35 server started at http://localhost:9876/
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 1.9.8 (Windows 7 0.0.0)]: Connected on socket FPQ9_PnLvN3UNXN4CjH4 with id 99835325
PhantomJS 1.9.8 (Windows 7 0.0.0): Executed 14 of 21 SUCCESS (0 secs / 0.155 secs)
PhantomJS 1.9.8 (Windows 7 0.0.0) Directive Tests Password strength Should display the password strength bar FAILED
Error: Unexpected request: GET i18n/zh-cn/global.json
Expected GET i18n/en/global.json
at $httpBackend (C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular-mocks/angular-mocks.js:1212)
at sendReq (C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:10233)
at C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:9944
at processQueue (C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:14454)
at C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:14470
at C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:15719
at C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:15530
at C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular-mocks/angular-mocks.js:1510
at C:/Users/me/projects/myapp/src/test/javascript/spec/app/account/password/password.directive.spec.js:27
PhantomJS 1.9.8 (Windows 7 0.0.0) Directive Tests Password strength Should change the first 2 points of the strength bar FAILED
Error: Unexpected request: GET i18n/zh-cn/global.json
Expected GET i18n/en/global.json
at $httpBackend (C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular-mocks/angular-mocks.js:1212)
at sendReq (C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:10233)
at C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:9944
at processQueue (C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:14454)
at C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:14470
at C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:15719
at C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:15530
at C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:15824
at C:/Users/me/projects/myapp/src/test/javascript/spec/app/account/password/password.directive.spec.js:41
Error: [$rootScope:inprog] $digest already in progress
http://errors.angularjs.org/1.4.0/$rootScope/inprog?p0=%24digest
at beginPhase (C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:16073)
at C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:15510
at C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular-mocks/angular-mocks.js:1510
at C:/Users/me/projects/myapp/src/test/javascript/spec/app/account/password/password.directive.spec.js:27
PhantomJS 1.9.8 (Windows 7 0.0.0) Directive Tests Password strength Should change the first 4 points of the strength bar FAILED
Error: Unexpected request: GET i18n/zh-cn/global.json
Expected GET i18n/en/global.json
at $httpBackend (C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular-mocks/angular-mocks.js:1212)
at sendReq (C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:10233)
at C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:9944
at processQueue (C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:14454)
at C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:14470
at C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:15719
at C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:15530
at C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:15824
at C:/Users/me/projects/myapp/src/test/javascript/spec/app/account/password/password.directive.spec.js:56
Error: [$rootScope:inprog] $digest already in progress
http://errors.angularjs.org/1.4.0/$rootScope/inprog?p0=%24digest
at beginPhase (C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:16073)
at C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:15510
at C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular-mocks/angular-mocks.js:1510
at C:/Users/me/projects/myapp/src/test/javascript/spec/app/account/password/password.directive.spec.js:27
PhantomJS 1.9.8 (Windows 7 0.0.0) Services Tests Auth should call LocalStorageService.clearAll on logout FAILED
Error: Unexpected request: GET i18n/zh-cn/global.json
Expected GET i18n/en/global.json
at $httpBackend (C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular-mocks/angular-mocks.js:1212)
at sendReq (C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:10233)
at C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:9944
at processQueue (C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:14454)
at C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:14470
at C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:15719
at C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:15530
at C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular-mocks/angular-mocks.js:1510
at C:/Users/me/projects/myapp/src/test/javascript/spec/components/auth/auth.services.spec.js:39
Error: [$rootScope:inprog] $digest already in progress
http://errors.angularjs.org/1.4.0/$rootScope/inprog?p0=%24digest
at beginPhase (C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:16073)
at C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular/angular.js:15510
at C:/Users/me/projects/myapp/src/main/webapp/bower_components/angular-mocks/angular-mocks.js:1542
at C:/Users/me/projects/myapp/src/test/javascript/spec/components/auth/auth.services.spec.js:27
PhantomJS 1.9.8 (Windows 7 0.0.0): Executed 21 of 21 (4 FAILED) (0.282 secs / 0.256 secs)
Warning: Task "karma:unit" failed. Use --force to continue.
Aborted due to warnings.
Execution Time (2015-07-16 18:04:35 UTC)
wiredep:test 3.8s █████████████████████ 23%
karma:unit 12.6s ███████████████████████████████████████████████████████████████████ 76%
Total 16.5s
For recent versions of jHipster this problem should not be occurring anymore, because there is now a regular expression that does not take into account the language in the path.
For older versions though, if you changed the default language then you must adapt password.directive.spec.js and auth.services.spec.js in order to expect the (now different) default language. Those lines are similar to this:
$httpBackend.expectGET('i18n/en/global.json').respond({});
(Notice "/en/" in the path, that part is the one that should match the current default language).

banquo/phantom nodejs error - Cannot read property 'createPage' of undefined

im trying to run https://github.com/ajam/banquo-server and receiving and error
Cannot read property 'createPage' of undefined
Express server listening on port 3000
Requesting http://america.aljazeera.com
/root/banquo-server/node_modules/banquo/src/banquo.js:36
ph.createPage(openPage);
^
TypeError: Cannot read property 'createPage' of undefined
at createPage (/root/banquo-server/node_modules/banquo/src/banquo.js:36:7)
at /root/banquo-server/node_modules/node-phantom/node-phantom.js:65:6
at null._onTimeout (/root/banquo-server/node_modules/node-phantom/node-phantom.js:43:5)
at Timer.listOnTimeout (timers.js:110:15)
error: Forever detected script exited with code: 1
error: Script restart attempt #7
connect.multipart() will be removed in connect 3.0
visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
connect.limit() will be removed in connect 3.0
I have checked and an error is being returned from node-phantom.js:36 but does not specify what.
any ideas?
regards
I've had the same issue and fixed it adding the phantomjs binary to PATH.
You can test if it is already set running the command:
$ phantomjs
The following error means that it isn't:
'phantomjs' is not recognized as an internal or external command, operable program or batch file
As you said in a comment:
not a bug as this works on my local mac, not on external server
So, that's not a problem with your code. That's a problem with your environment so I guess that you also missed to set the PATH variable.

Resources