The tests on this package are failing for me, with Node version 6.10.2.
$ npm run test
> [email protected] test /home/jsmith/Git/nodejs-expand-range/package
> mocha
expand range
✓ should return the number as an array if no range is specified
✓ should throw when the first arg is not a string.
✓ should expand numerical ranges
✓ should expand negative ranges
✓ should expand alphabetical ranges
✓ should fill in numerical ranges
✓ should fill in numerical ranges when numbers are passed as strings
✓ should fill in negative ranges
✓ should fill in rangines using the given increment
✓ should fill in negative ranges using the given increment
✓ should fill in negative ranges using the given increment
✓ should fill in alphabetical ranges
✓ should use increments with alphabetical ranges
special characters:
1) should repeat the first arg `n` times:
2) should collapse values when `>` is passed:
3) should randomize using the first two args when `?` is passed:
4) should join the array using `|` as the separator:
character classes:
5) should return a string for a regex range when `true` is passed:
6) should return a string for a regex when `~` or `|` are passed:
7) should make a logical or when the range is out-of-order:
8) should prefix the regex string when a `prefix` is passed on options:
✓ should return the string when arguments are invalid:
9) should return null for invalid patterns:
when a custom function is used for expansions
✓ should expose the current value as the first param.
✓ should expose the `isNumber` boolean as the third param.
✓ should expose any padding as the third param.
10) should expose the index as the third param.
17 passing (28ms)
10 failing
1) special characters: should repeat the first arg `n` times::
AssertionError: [] deepEqual [ 'a', 'a', 'a' ]
+ expected - actual
+[
+ "a"
+ "a"
+ "a"
+]
-[]
at Context.<anonymous> (test.js:108:12)
2) special characters: should collapse values when `>` is passed::
AssertionError: [] deepEqual [ 'abcde' ]
+ expected - actual
+[
+ "abcde"
+]
-[]
at Context.<anonymous> (test.js:114:12)
3) special characters: should randomize using the first two args when `?` is passed::
AssertionError: false == true
+ expected - actual
+true
-false
at Context.<anonymous> (test.js:126:5)
4) special characters: should join the array using `|` as the separator::
AssertionError: [] deepEqual [ '[a-c]' ]
+ expected - actual
+[
+ "[a-c]"
+]
-[]
at Context.<anonymous> (test.js:132:12)
5) character classes: should return a string for a regex range when `true` is passed::
AssertionError: '[a-e]' deepEqual [ '[a-e]' ]
at Context.<anonymous> (test.js:140:12)
6) character classes: should return a string for a regex when `~` or `|` are passed::
AssertionError: [] deepEqual [ '(A|F|K|P)' ]
+ expected - actual
+[
+ "(A|F|K|P)"
+]
-[]
at Context.<anonymous> (test.js:147:12)
7) character classes: should make a logical or when the range is out-of-order::
AssertionError: [] deepEqual [ '(c|b|a)' ]
+ expected - actual
+[
+ "(c|b|a)"
+]
-[]
at Context.<anonymous> (test.js:151:12)
8) character classes: should prefix the regex string when a `prefix` is passed on options::
AssertionError: [] deepEqual [ '(?!c|b|a)' ]
+ expected - actual
+[
+ "(?!c|b|a)"
+]
-[]
at Context.<anonymous> (test.js:158:12)
9) character classes: should return null for invalid patterns::
AssertionError: [] == null
at Context.<anonymous> (test.js:167:12)
10) when a custom function is used for expansions should expose the index as the third param.:
AssertionError: [ 'a', 'b', 'c', 'd', 'e' ] deepEqual [ 'a0', 'b1', 'c2', 'd3', 'e4' ]
+ expected - actual
[
+ "a0"
+ "b1"
+ "c2"
+ "d3"
+ "e4"
- "a"
- "b"
- "c"
- "d"
- "e"
]
at Context.<anonymous> (test.js:216:12)