Giter VIP home page Giter VIP logo

expand-range's Issues

Tests fail

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.