Skip to content
This repository was archived by the owner on Jun 28, 2021. It is now read-only.

Commit 3113b32

Browse files
committed
test: cast info properties
1 parent 94dbac2 commit 3113b32

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

test/option.cast.coffee

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,22 @@ describe 'Option `cast`', ->
5656

5757
describe 'function', ->
5858

59-
it 'custom function', (next) ->
59+
it.only 'custom function', (next) ->
60+
parse """
61+
hello
62+
""",
63+
cast: (value, context) ->
64+
Object.keys context
65+
, (err, records) ->
66+
records.should.eql [
67+
[[
68+
'column', 'empty_lines', 'error', 'header', 'index'
69+
'invalid_field_length', 'quoting', 'lines', 'records'
70+
]]
71+
] unless err
72+
next err
73+
74+
it 'return anything, eg a string or an object', (next) ->
6075
parse """
6176
2000-01-01,date1
6277
2050-11-27,date2

0 commit comments

Comments
 (0)