-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from IWSLLC/issue-23
updating dependencies, fixing 23; also fixes undefined columns
- Loading branch information
Showing
4 changed files
with
43 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
language: node_js | ||
node_js: | ||
- '5' | ||
- '4' | ||
- '7' | ||
- '6' | ||
- '0.10' | ||
script: "mocha" | ||
cache: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
jsoncsv = require '../index' | ||
should = require "should" | ||
|
||
describe "Issue 23", -> | ||
describe "When excluding label definitions", -> | ||
before (done) -> | ||
@items = [{a: "first", b: "second"}, {a: "third", b:"fourth"}, {a: "fifth", b: "sixth"}] | ||
jsoncsv.csvBuffered @items, { | ||
fields: [ | ||
{name: "a", label: "a"} | ||
{name: "b"} # this is breaking (before fix) | ||
]}, (err, csv) => | ||
@csv = csv | ||
@err = err | ||
done() | ||
|
||
it "should export a and b", -> @csv.should.equal "a,b\r\nfirst,second\r\nthird,fourth\r\nfifth,sixth\r\n" | ||
|
||
#also this issue came up (because of the first one) | ||
describe "When exporting a column that resolves undefined in the data set", -> | ||
before (done) -> | ||
@items = [{a: "first", b: "second"}, {a: "third", b:"fourth"}, {a: "fifth", b: "sixth"}] | ||
jsoncsv.csvBuffered @items, { | ||
fields: [ | ||
{name: "a"} | ||
{name: "b"} | ||
{name: "c"} #breaking before fix | ||
]}, (err, csv) => | ||
@csv = csv | ||
@err = err | ||
done() | ||
|
||
it "should export a, b, and c", -> @csv.should.equal "a,b,c\r\nfirst,second,\r\nthird,fourth,\r\nfifth,sixth,\r\n" |