From d4d1a13182f8f637971d0b8adbc640415a000c55 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Thu, 13 Aug 2020 21:00:48 +0100 Subject: [PATCH] test: failing coercion tests with option coerceTypes: array --- spec/coercion.spec.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/spec/coercion.spec.js b/spec/coercion.spec.js index a9f13de5c..1a8426af1 100644 --- a/spec/coercion.spec.js +++ b/spec/coercion.spec.js @@ -144,12 +144,17 @@ var coercionArrayRules = JSON.parse(JSON.stringify(coercionRules)); coercionArrayRules.string.array = [ { from: ['abc'], to: 'abc' }, { from: [123], to: '123' }, + { from: [true], to: 'true'}, + { from: [null], to: ''}, { from: ['abc', 'def'], to: undefined }, { from: [], to: undefined } ]; coercionArrayRules.number.array = [ { from: [1.5], to: 1.5 }, - { from: ['1.5'], to: 1.5 } + { from: ['1.5'], to: 1.5 }, + { from: [true], to: 1 }, + { from: [null], to: 0 }, + // { from: ['abc'], to: undefined }, ]; coercionArrayRules.integer.array = [ { from: [1], to: 1 }, @@ -160,13 +165,16 @@ coercionArrayRules.integer.array = [ coercionArrayRules.boolean.array = [ { from: [true], to: true }, { from: ['true'], to: true }, - { from: [1], to: true } + { from: [1], to: true }, + // { from: ['abc'], to: undefined }, + // { from: [2], to: undefined }, ]; coercionArrayRules.null.array = [ { from: [null], to: null }, { from: [''], to: null }, { from: [0], to: null }, - { from: [false], to: null } + { from: [false], to: null }, + // {from: [true], to: undefined}, ]; coercionArrayRules.object.array = [ { from: [{}], to: undefined }