mageddo / javascript-csv

Automatically exported from code.google.com/p/jquery-csv
MIT License
1 stars 1 forks source link

Karma test fails - #35

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run an angular project using jquery-csv
2. Run Test
3. Test fails with following message "TypeError: Cannot call method 'replace' 
of undefined" :

Whole trace :

What is the expected output? What do you see instead?

Expected output is that test should pass.

What I have instead :

Starting Karma Server (http://karma-runner.github.io)
-------------------------------------------------------------------
INFO [karma]: Karma v0.10.6 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 31.0.1650 (Mac OS X 10.7.5)]: Connected on socket 
ao7xN3nbm-oTCCNMTnpx
Chrome 31.0.1650 (Mac OS X 10.7.5) Controller: IndexCtrl should have at least 
one entry in vmcollection FAILED
    TypeError: Cannot call method 'replace' of undefined
        at Object.$.csv.parsers.parseEntry (/Users/nsteinmetz/Documents/Projets/angular/vmagindex/app/vendor/jquery-csv/jquery.csv-0.71.js:501:13)
        at Object.$.csv.toArray (/Users/nsteinmetz/Documents/Projets/angular/vmagindex/app/vendor/jquery-csv/jquery.csv-0.71.js:618:33)
        at Object.$.csv.toObjects (/Users/nsteinmetz/Documents/Projets/angular/vmagindex/app/vendor/jquery-csv/jquery.csv-0.71.js:733:27)
        at $http.transformResponse (/Users/nsteinmetz/Documents/Projets/angular/vmagindex/app/js/controllers.js:13:26)
        at transformData (/Users/nsteinmetz/Documents/Projets/angular/vmagindex/app/lib/angular/angular.js:6819:12)
        at transformResponse (/Users/nsteinmetz/Documents/Projets/angular/vmagindex/app/lib/angular/angular.js:7491:17)
        at wrappedCallback (/Users/nsteinmetz/Documents/Projets/angular/vmagindex/app/lib/angular/angular.js:10689:81)
        at /Users/nsteinmetz/Documents/Projets/angular/vmagindex/app/lib/angular/angular.js:10775:26
        at Scope.$eval (/Users/nsteinmetz/Documents/Projets/angular/vmagindex/app/lib/angular/angular.js:11668:28)
        at Scope.$digest (/Users/nsteinmetz/Documents/Projets/angular/vmagindex/app/lib/angular/angular.js:11513:31)
Chrome 31.0.1650 (Mac OS X 10.7.5): Executed 4 of 4 (1 FAILED) (0.74 secs / 
0.145 secs)

Test is about checking that length of my object once the csv has been parsed.

What version of the product are you using? On what operating system?

0.71 version.
AngularJS 1.21

Please provide any additional information below.

Let me know if you need more code samples. I should publish it soon.

Original issue reported on code.google.com by nsteinm...@gmail.com on 30 Nov 2013 at 11:26

GoogleCodeExporter commented 8 years ago
You can close the bug, it was a misunderstanding on how angular mock data for 
unit testing ; I fixed it in my code.

Sorry for the noise.

Original comment by nsteinm...@gmail.com on 14 Dec 2013 at 9:00

GoogleCodeExporter commented 8 years ago
Haha, good. I'm just now starting to familiarize myself with AngularJs. I've 
been avoiding this issue for that reason.

Original comment by evanpla...@gmail.com on 15 Dec 2013 at 7:17