From 3113b324638d746f28f7e2944a31d0f226a14b84 Mon Sep 17 00:00:00 2001 From: David Worms Date: Thu, 20 May 2021 09:54:14 +0200 Subject: [PATCH] test: cast info properties --- test/option.cast.coffee | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/test/option.cast.coffee b/test/option.cast.coffee index ee3f13d..08f5d45 100644 --- a/test/option.cast.coffee +++ b/test/option.cast.coffee @@ -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