underscore.string icon indicating copy to clipboard operation
underscore.string copied to clipboard

improve tests, prevent errors in toSentence([]) and unquote(null)

Open maciej-ka opened this issue 10 years ago • 2 comments

Functionality changes

toSentence

  • Result of toSentence([]) is "" (previously it rised an error).
  • Empty strings, null and undefined in array are ommited ... so toSentence([null, 'test', undefined]) will return 'test' (previously it was "null, test and undefined")

unquote

  • Result of unqote(null) is "" (previously it rised an error).

Test improvements

camelizeze

  • add uppercase string cases to test decapitalization
  • remove similar cases of string with spaces

capitalize

  • remove duplicate assertion

chop

  • (formatting) remove space inside array

escapeRegExp

  • add cases with null and undefined

lpad

  • add case with length shorter than string

naturalCms

  • add cases with numbers, empty strings, undefined and null

pad

  • add case with length shorter than string

repeat

  • add case with 0 and 1 repetitions

rpad

  • add case with length shorter than string

splice

  • add case with no substring
  • add cases with null and undefined

toBoolean

  • add cases with true, false, null and undefined

toSentence

  • add cases with empty array, empty string, null and undefined

unquote

  • add cases for empty string, null and undefined

maciej-ka avatar Oct 20 '15 09:10 maciej-ka

@lokson Thx for your awesome work! Will review tonight.

stoeffel avatar Oct 20 '15 10:10 stoeffel

Ready with filter and omitted changes in dist - thanks for review.

maciej-ka avatar Oct 20 '15 18:10 maciej-ka