I've installed Karma, now what? - karma-runner

I've installed and implemented Karma in my project, but I'm not sure where to go from here.
I have one a very simple jasmine spec just to test Karma:
describe 'A suite', ->
it 'contains spec with an expectation', ->
expect(true).toBe true
However, where do I go from here?
Here's how it looks when I visit it in a browser:
Where is my jasmine spec?
Here's how my console looks:
rake karma:start
INFO [karma]: Karma v0.12.28 server started at http://localhost:9876/_karma_/
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 1.9.8 (Linux)]: Connected on socket FNsNSoQPPqyGCqhqIduv with id 80517079
PhantomJS 1.9.8 (Linux) LOG: 'WARNING: Tried to load angular more than once.'
PhantomJS 1.9.8 (Linux) ERROR
TypeError: 'undefined' is not a function (evaluating 'window.angular.$$csp()')
at /var/lib/gems/1.9.1/gems/rails-assets-angular-1.3.8/app/assets/javascripts/angular/angular.js:26070
INFO [Chrome 39.0.2171 (Linux)]: Connected on socket HbXSzzvaLb-tMVMNIduw with id manual-2655
PhantomJS 1.9.8 (Linux) LOG: 'WARNING: Tried to load angular more than once.'
PhantomJS 1.9.8 (Linux) ERROR
TypeError: 'undefined' is not a function (evaluating 'window.angular.$$csp()')
at /var/lib/gems/1.9.1/gems/rails-assets-angular-1.3.8/app/assets/javascripts/angular/angular.js:26070
Chrome 39.0.2171 (Linux) LOG: 'WARNING: Tried to load angular more than once.'
Chrome 39.0.2171 (Linux) ERROR
Uncaught TypeError: undefined is not a function
at /var/lib/gems/1.9.1/gems/rails-assets-angular-1.3.8/app/assets/javascripts/angular/angular.js:26070
Again, not a hint of my spec
Are these error messages causing a problem?
Chrome 39.0.2171 (Linux) LOG: 'WARNING: Tried to load angular more than once.'
Chrome 39.0.2171 (Linux) ERROR
Uncaught TypeError: undefined is not a function
at /var/lib/gems/1.9.1/gems/rails-assets-angular-1.3.8/app/assets/javascripts/angular/angular.js:26070
Sorry if this is vague, but I have no idea what should happen. I'm expecting when I visit localhost:9876/_karma_/ for all my jasmine spec(s) to show. I'm expecting similiar output in the console from PhantomJS but nothing is happening! I've got nothing to go on.
Any help greatly appreciated (Definitely be awarding a bounty) on how I display my spec(s)!

Loading angular twice is definitely the issue here. If you have used ...**/angular.js in the files element of the karma config file, I bet there are multiple angular.js files in your project, was the case for me.... You can inspect the karma page and find the sources to see what files were loaded. Good luck!

Yeah, you have to fix an issue. Do you use coffescript processor?
You can clone https://github.com/yearofmoo/angularjs-seed-repo repo to look at proper config for Karma and Protractor test cases.
Also, you can select one of neat reporter instead of process. Look at npm repository

From what I gather, if you only require karma unit testing (not end to end) then you can remove the ng-scenario framework from the karma configuration and it should be possible to run
rake karma:start
Admittedly this doesn't solve the problem entirely but it might get you going if you are stuck.

Related

Visual Studio Code Extension Install/Update Error: "Failed to load resource: net::ERR_CONNECTION_RESET"

Why can't I download or update any extensions from VS Code 1.54.3 on Windows 10 1930?
Every time I tried to update or install those extensions, it always shows this error in the Dev Tools:
Failed to load resource: net::ERR_CONNECTION_RESET
ERR [uncaught exception in sharedProcess]: XHR failed: downloading: XHR failed at
It says "XHR failed" and I can't find the fix for this issue.
The problem was solved in the comments:
Daantje:
It looks like VSCode cant connect to the download server, did you try disabling your firewall and check if it works? It could be that you block a download host? Here is a list of common hosts used by Code: code.visualstudio.com/docs/setup/network
Brandon Ivander:
Solved, i disabled my firewall and it works, thanks #Daantje

How to handle with webdrivers in visual studio code Protractor?

I was getting an error
WebDriverError: unknown error: cannot determine loading status
from unknown error: missing or invalid 'entry.level'
(Session info: chrome=76.0.3809.100)
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 10.0.17134 x86_64)
I updated the Visual Studio Code a few days ago. Now i think that it is incompatible with ChromeDriver. I'm using chrome76.
Before updating VS code it was working correctly But now it gives that error. I searched on everywhere on net
Some of them telling that upgrade chrome driver etc. Kindly upload complete procedure how to check for software and how to handle that.
Looks like you are still having old version of chromedriver=2.27.440174 , you should update protractor to use latest version of chromedriver_76.0.3809.12.zip
Try Updating Webdriver Manager:
webdriver-manager update
webdriver-manager update is the command that will automatically update the Chrome driver But some time is not update Because of slow performance For that i Shutdown my PC, after few hours it updated Automatically

sample-Groceries, Failed to find module: 'platform'

While i am following the nativescript with angular tutorial, my command prompt says "Successfully deployed on device with identifier 'emulator-5554'" but the emulator thrown the error below.
Error calling module function
Error: com.tns.NativeScriptException: Failed to find
module: 'platform', relative to: app/tns_modules/
com.tns.Module.resolvePathHelper(Module.java:159)
com.tns.Module.resolvePath(Module.java:6O)
com.tns.Runtime.runModule(Native Method)
com.tns.Runtime.runModule(Runtime.java:514)
com.tns.Runtime.run(Runtime.java:509)
com.tns.NativeScriptApplication.on
Create(NativeScriptApplication.java:17)
android. a pp.1 nst rum e ntat ion. call AppationOnCreate(lnstrumentation.java:1024)
android. app. ActivityThread.handleBindApplication(ActivityThread.java:5361).
Please help.
Thank you.
Delete platforms and node_modules folders and rebuild the application with the respective command for the platform you are using.
e.g. tns run android

Ionic2 first project error

I'm trying to follow these instruction : http://ionicframework.com/docs/v2/getting-started/installation/
But I have error with this line :
ionic start cutePuppyPics --v2
Creating Ionic app in folder C:\dev\debug npm\cutePuppyPics based on tabs projec
t
Downloading: https://github.com/driftyco/ionic2-app-base/archive/master.zip
Error with start Error: read ECONNRESET
at exports._errnoException (util.js:870:11)
at TLSWrap.onread (net.js:552:26)
Error Initializing app: Error: read ECONNRESET
Error: read ECONNRESET
at exports._errnoException (util.js:870:11)
at TLSWrap.onread (net.js:552:26)
Caught exception:
Error: read ECONNRESET
at exports._errnoException (util.js:870:11)
at TLSWrap.onread (net.js:552:26)
Mind letting us know? https://github.com/driftyco/ionic-cli/issues
Does anyone can help me ?
Thanks by advance !
Just like #AnatolyS says, that seems to be a network problem. Once you download it, (and unzip it) open a console at the same level you see a file called package.json and run npm install. That will install all the required dependencies for the project.
Once that is done, run ionic serve and the application should be opened in the browser.

Protractor / Chrome - UnknownError: The process has not exited yet therefore no result is available

Trying to run a Protractor test but am receiving the following command line error when trying to test in Chrome.
UnknownError: The process has not exited yet therefore no result is available ...
The test successfully runs in Firefox, i.e. when the protractor.conf.js file is set as such:
capabilities: {
'browserName': 'firefox'
}
I'm currently using ChromeDriver 2.10, which seems to have something to do with the issue (https://github.com/angular/protractor/issues/1424). However, I'm unclear how to configure Protractor to use a different version of ChromeDriver.
So, reverting to ChromeDriver 2.9 was as easy as downloading it from here (http://chromedriver.storage.googleapis.com/index.html?path=2.9/) and extracting the zip into /usr/local/lib/node_modules/protractor/selenium.
That fixed the immediate issue of not being able to run the test in Chrome. Still waiting on a fix for 2.10, I suppose.