Browse Source

adding comments to the tests

content-update
MSilva95 4 years ago committed by Clément
parent
commit
38d678dc50
  1. 22
      js/tests/using-filter_test.js

22
js/tests/using-filter_test.js

@ -9,7 +9,7 @@ const check = ({ filterCalls }, eq, a, b) => {
} }
t(({ eq, ctx }) => t(({ eq, ctx }) =>
// check that the code did use filter properly // check that the code did use filter properly
check(ctx, eq, filterShortStateName(ctx.arr1), [ check(ctx, eq, filterShortStateName(ctx.arr1), [
'Alaska', 'Alaska',
'Hawaii', 'Hawaii',
@ -22,11 +22,11 @@ t(({ eq, ctx }) =>
'Oregon', 'Oregon',
'Texas', 'Texas',
'Utah', 'Utah',
]), ])
) )
t(({ eq, ctx }) => t(({ eq, ctx }) =>
// check that the code did use filter properly // check that the code did use filter properly
check(ctx, eq, filterStartVowel(ctx.arr1), [ check(ctx, eq, filterStartVowel(ctx.arr1), [
'Alabama', 'Alabama',
'Alaska', 'Alaska',
@ -40,11 +40,11 @@ t(({ eq, ctx }) =>
'Oklahoma', 'Oklahoma',
'Oregon', 'Oregon',
'Utah', 'Utah',
]), ])
) )
t(({ eq, ctx }) => t(({ eq, ctx }) =>
// check that the code did use filter properly // check that the code did use filter properly
check(ctx, eq, filter5Vowels(ctx.arr1), [ check(ctx, eq, filter5Vowels(ctx.arr1), [
'California', 'California',
'Louisiana', 'Louisiana',
@ -52,11 +52,11 @@ t(({ eq, ctx }) =>
'South Carolina', 'South Carolina',
'South Dakota', 'South Dakota',
'West Virginia', 'West Virginia',
]), ])
) )
t(({ eq, ctx }) => t(({ eq, ctx }) =>
// check that the code did use filter properly // check that the code did use filter properly
check(ctx, eq, filter1DistinctVowel(ctx.arr1), [ check(ctx, eq, filter1DistinctVowel(ctx.arr1), [
'Alabama', 'Alabama',
'Alaska', 'Alaska',
@ -66,11 +66,11 @@ t(({ eq, ctx }) =>
'Mississippi', 'Mississippi',
'New Jersey', 'New Jersey',
'Tennessee', 'Tennessee',
]), ])
) )
t(({ eq, ctx }) => t(({ eq, ctx }) =>
// check that the code did use filter properly // check that the code did use filter properly
check(ctx, eq, multiFilter(ctx.arr2), [ check(ctx, eq, multiFilter(ctx.arr2), [
{ tag: 'CA', name: 'California', capital: 'Sacramento', region: 'West' }, { tag: 'CA', name: 'California', capital: 'Sacramento', region: 'West' },
{ tag: 'HI', name: 'Hawaii', capital: 'Honolulu', region: 'West' }, { tag: 'HI', name: 'Hawaii', capital: 'Honolulu', region: 'West' },
@ -92,7 +92,7 @@ t(({ eq, ctx }) =>
capital: 'Providence', capital: 'Providence',
region: 'Northeast', region: 'Northeast',
}, },
]), ])
) )
Object.freeze(tests) Object.freeze(tests)
@ -291,7 +291,7 @@ export const setup = () => {
}, },
{ tag: 'WI', name: 'Wisconsin', capital: 'Madison', region: 'Midwest' }, { tag: 'WI', name: 'Wisconsin', capital: 'Madison', region: 'Midwest' },
{ tag: 'WY', name: 'Wyoming', capital: 'Cheyenne', region: 'West' }, { tag: 'WY', name: 'Wyoming', capital: 'Cheyenne', region: 'West' },
].map((e) => Object.freeze(e)), ].map((e) => Object.freeze(e))
) )
return { filterCalls, arr1, arr2 } return { filterCalls, arr1, arr2 }

Loading…
Cancel
Save