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

Commit

Permalink
test: cast info properties
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed May 20, 2021
1 parent 94dbac2 commit 3113b32
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion test/option.cast.coffee
Expand Up @@ -56,7 +56,22 @@ describe 'Option `cast`', ->

describe 'function', ->

it 'custom function', (next) ->
it.only 'custom function', (next) ->
parse """
hello
""",
cast: (value, context) ->
Object.keys context
, (err, records) ->
records.should.eql [
[[
'column', 'empty_lines', 'error', 'header', 'index'
'invalid_field_length', 'quoting', 'lines', 'records'
]]
] unless err
next err

it 'return anything, eg a string or an object', (next) ->
parse """
2000-01-01,date1
2050-11-27,date2
Expand Down

0 comments on commit 3113b32

Please sign in to comment.