Why the unused, confusing functionality ( delimeter ) in the example solution?
This is a 7 kyu kata; beginners might look up your solution to see how it should canonically be done, it should be as clean, simple and efficient as you can make it.
Using the same input for six assertions at a time would mean you only need two reference solutions ( generate a string, calculate the corresponding array and set, use those values as inputs and expected outputs ).
The it-headers of the random tests could show values in a nicer way. Use JSON.stringify for strings and arrays, and maybe mock up something custom to replicate the output of console.log(set)?
Use strictEqual for strings.
args is just a wrapper for Array.from. Also, it's just unnecessary if you pass a single string instead of a list of chars.
Actual tests contain some weird, undocumented required behaviours such as pullAll(array, values), which is not required in any fixed tests. The current fixed/sample test cases are definitely not enough in showing the full required specs.
When taking inspiration from other kata, make sure it's not just an inverted duplicate. This is. Incomplete specs do not make this not a duplicate of the other kata. The idea is just no longer novel.
For input [["i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i","i"]]: expected +0 to equal 1
Why the unused, confusing functionality ( delimeter ) in the example solution?
This is a 7 kyu kata; beginners might look up your solution to see how it should canonically be done, it should be as clean, simple and efficient as you can make it.
99 more random tests wouldn't hurt.
Using the same input for six assertions at a time would mean you only need two reference solutions ( generate a string, calculate the corresponding array and set, use those values as inputs and expected outputs ).
The
it
-headers of the random tests could show values in a nicer way. UseJSON.stringify
for strings and arrays, and maybe mock up something custom to replicate the output of console.log(set)?Use
strictEqual
for strings.args
is just a wrapper forArray.from
. Also, it's just unnecessary if you pass a single string instead of a list of chars.If the optional header is missing, is it considered valid?
Actual tests contain some weird, undocumented required behaviours such as
pullAll(array, values)
, which is not required in any fixed tests. The current fixed/sample test cases are definitely not enough in showing the full required specs.This comment is hidden because it contains spoiler information about the solution
You should factor out the random generation and the reference solution from the random tests. This is not maintainable.
When taking inspiration from other kata, make sure it's not just an inverted duplicate. This is. Incomplete specs do not make this not a duplicate of the other kata. The idea is just no longer novel.
Needs
puzzle
tag.If this is unintentional, the specifications are incomplete.
( I do not agree with your specs anyway. Non-numbers can't be odd. )
If strings are to be coerced to numbers, not expecting booleans to be coerced to numbers is inconsistent.
The messages in the
Set
tests are wrong: