I try to use phantomJS with Jasmine. But my fixtures can't be load because an error
Error: JSONFixture could not be loaded: assets/backend/fixtures/json/fr.json (status: error, message: NETWORK_ERR: XMLHttpRequest Exception 101)
I can see here I must add option to phantomJS for disable cross-server security.
Phantom JS synchronous AJAX request : NETWORK_ERR: XMLHttpRequest Exception 101
or here:
grunt-contrib-jasmine and PhantomJS security
But I don't know where to pass this options because phantomJS is called automatically when call:
bundle exec rake spec:javascript
or
bundle exec Guard -g frontend
So you can see I use Guard too but I think it's the next step.
Thanks to read and best regards
Add the below to your jasmine.yml file
phantom_options: --web-security=no
Related
I use Protractor 7.0 and Jasemine 3.6.1, but when i use .withContext(), I get Failed: expect(...).toEqual(...).withContext is not a function error message.
I have searched the issue and the people suggest to update the Jasmine and Protractor, but it doesn't help.
I am using Jasmine and Karma for my front end unit tests. When running my tests I get the following errors:
Terminal Error
Chrome 59.0.3071 (Mac OS X 10.11.6) ERROR
Uncaught Response with status: 404 Not Found for URL: http://localhost:9876/api/volunteer
at http://localhost:9876/_karma_webpack_/polyfills.bundle.js:2604
Chrome 59.0.3071 (Mac OS X 10.11.6): Executed 4 of 6 ERROR (0 secs / 1.02 secs)
Chrome 59.0.3071 (Mac OS X 10.11.6) ERROR
Uncaught Response with status: 404 Not Found for URL: http://localhost:9876/api/volunteer
Chrome 59.0.3071 (Mac OS X 10.11.6): Executed 4 of 6 ERROR (1.433 secs / 1.02 secs)
Browser Errors
SignUpComponent should be created
[object ErrorEvent] thrown
SignUpComponent form should clear on submit
[object ErrorEvent] thrown
I cannot figure out why the terminal tells me I have a 404 error and the browser tells me I have an error within sign-up.component.spec.ts. sign-up.component.spec.ts does not make any http requests.
SignUpComponent can be found in client/app/sign-up/sign-up.component.spec.ts at the following repository:
https://github.com/cerberus-org/cerberus-app
Something I noticed when attempting to debug was if I commented out client/app/shared/volunteer.service.spec.ts all tests would pass even though the error points to client/app/sign-up/sign-up.component.spec.ts.
Any insights appreciated.
I believe I was receiving this error because the back end was not properly mocked. I did not use XHRBackend, so when other tests attempted to make an http call, the call was not intercepted and handled by the mock backend.
I was able to properly mock my backend by following this tutorial:
https://semaphoreci.com/community/tutorials/testing-services-in-angular-2
'The Rest' section of this tutorial was most relevant.
I'm getting a blank page and this error when testing my aurelia app. It worked until I made a bunch of changes and I don't know which one broke it. vendor-bundle.js:13551 is inside core code. I've got debug messages showing as you can see.Is there a way to find what causes an error like this other than undoing each change one at a time?
... snipped ...
DEBUG [aurelia] Configured plugin aurelia-templating-router.
DEBUG [aurelia] Loading plugin resources/index.
Uncaught SyntaxError: Unexpected token export
vendor-bundle.js:13551 Uncaught TypeError: Cannot read property '__useDefault' of undefined
at ensureOriginOnExports (vendor-bundle.js:13551)
at vendor-bundle.js:13659
at Object.execCb (vendor-bundle.js:5432)
at Module.check (vendor-bundle.js:4620)
at Module.<anonymous> (vendor-bundle.js:4875)
at vendor-bundle.js:3873
at vendor-bundle.js:4925
at each (vendor-bundle.js:3798)
at Module.emit (vendor-bundle.js:4924)
at Module.check (vendor-bundle.js:4675)
at Module.enable (vendor-bundle.js:4912)
at Module.init (vendor-bundle.js:4525)
at callGetModule (vendor-bundle.js:4939)
at Object.completeLoad (vendor-bundle.js:5347)
at HTMLScriptElement.onScriptLoad (vendor-bundle.js:5453)
I have a donejs application and its running ok in development mode donejs develop, but when I run it in production mode:
donejs build
donejs deploy (to firebase)
NODE_ENV=production donejs start
it will not start and show an error (see CODE A)
This file: file:my-app/dist/bundles/my-app/index.js:704 corresponds to JQuery 3.x and its not a dependency of the project itself but a dependency of can-connect-feathers (https://github.com/canjs/can-connect-feathers). In fact in index.js there is also included JQuery 2.x what makes me think there might be some sort of incompatibility among them.
I already tried changing the project's dependency to JQuery 3.x but didn't help. Actually it will make even donejs develop fail (see CODE B).
I also tried the following:
cd my-app/node_modules/steal
npm install
but didn't help, another error appears and finally tried cd my-app/node_modules/can && npm install but that end up in multiple errors.
I'm using:
donejs#0.9.2
node#4.6.2
npm#2.15.11
can-connect-feathers#1.2.1
CODE A
NODE_ENV=production donejs start
my-app#0.0.0 start my-app
done-serve --proxy http://localhost:3030 --port 8080
done-serve starting on http://localhost:8080
Potentially unhandled rejection [5] TypeError: Error loading "package.json!npm" at file:my-app/package.json
Error loading "bundles/my-app/index" at file:my-app/dist/bundles/my-app/index.js
Error evaluating file:my-app/dist/bundles/my-app/index.js
Cannot read property 'createElement' of undefined
at i (file:my-app/dist/bundles/my-app/index.js:704:20)
at file:my-app/dist/bundles/my-app/index.js:1039:2881
at file:my-app/dist/bundles/my-app/index.js:1039:3580
at file:my-app/dist/bundles/my-app/index.js:268:21
at file:my-app/dist/bundles/my-app/index.js:268:27
at Object.exports.runInThisContext (vm.js:54:17)
at doEval (my-app/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:2059:10)
at __eval (my-app/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:1976:7)
at Loader.exec [as __exec] (my-app/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:339:5)
at Loader.loader.instantiate (my-app/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:1517:16)
CODE B
donejs develop
my-app#0.0.0 develop my-app
done-serve --develop --proxy http://localhost:3030 --port 8080
done-serve starting on http://localhost:8080
Potentially unhandled rejection [8] Error: Error loading "my-app#0.0.0#index.stache!done-autorender#0.8.0#autorender" at <unknown>
Error loading "can#2.3.27#util/jquery/jquery" at file:my-app/node_modules/can/util/jquery/jquery.js
Error loading "can#2.3.27#util/jquery/jquery" from "done-autorender#0.8.0#autorender" at file:my-app/node_modules/done-autorender/src/autorender.js
Did not find ./node_modules/can/node_modules/jquery/package.json
at FetchTask.utils.extend.next (file:my-app/node_modules/steal/ext/npm-crawl.js:532:11)
at file:my-app/node_modules/steal/ext/npm-crawl.js:556:33
at tryCatchReject (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:1183:30)
at runContinuation1 (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:1142:4)
at Fulfilled.when (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:930:4)
at Pending.run (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:821:13)
at Scheduler._drain (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:97:19)
at Scheduler.drain (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:62:9)
at nextTickCallbackWith0Args (node.js:436:9)
at process._tickCallback (node.js:365:13)
Potentially unhandled rejection [16] Error: Error loading "can#2.3.27#util/jquery/jquery" at file:my-app/node_modules/can/util/jquery/jquery.js
Error loading "can#2.3.27#util/jquery/jquery" from "my-app#0.0.0#index.stache!done-autorender#0.8.0#autorender" at file:my-app/src/index.stache
Did not find ./node_modules/can/node_modules/jquery/package.json
at FetchTask.utils.extend.next (file:my-app/node_modules/steal/ext/npm-crawl.js:532:11)
at file:my-app/node_modules/steal/ext/npm-crawl.js:556:33
at tryCatchReject (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:1183:30)
at runContinuation1 (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:1142:4)
at Fulfilled.when (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:930:4)
at Pending.run (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:821:13)
at Scheduler._drain (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:97:19)
at Scheduler.drain (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:62:9)
at nextTickCallbackWith0Args (node.js:436:9)
at process._tickCallback (node.js:365:13)
If the double jQuery installation is the issue, it should be resolved by version 2.0.0, which is exactly the same as the 1.0 version, but requires that you pass in a jQuery package as the jquery option. So, in addition to whatever else you had in your can-connect-feathers config, you'll need to provide the jquery option:
import $ from 'jquery'
import Feathers from 'can-connect-feathers';
new Feathers({
jquery: $
});
I'm using protractor with jasmine framework to run my automation scripts. The test is failing with the following error:
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
Warning: Tests failed, protractor exited with code: 3 Use --force to continue.
while trying to get attribute value of an element.
But, I'm able to perform clicks and verifyElementPresent kind of actions for the same web element..
Could any one please help me out of this how to overcome this error.
Thanks in advance..