Skip to content

Commit

Permalink
test: failing coercion tests with option coerceTypes: array
Browse files Browse the repository at this point in the history
  • Loading branch information
epoberezkin committed Aug 13, 2020
1 parent a1ebd03 commit d4d1a13
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions spec/coercion.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand All @@ -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 }
Expand Down

0 comments on commit d4d1a13

Please sign in to comment.