genish.js icon indicating copy to clipboard operation
genish.js copied to clipboard

Improve tests

Open danigb opened this issue 8 years ago • 0 comments

Currently the test are failing, although I think it's easy to fix it. However looking at the tests is painful since they are all inside the same file. My proposal:

  • Separate benchmarks from tests. Create a benchmarks folder.
  • Split the gen.tests.js by module.
  • Fix the failing tests
  • Add missing tests

Here's my output:

  50 passing (96ms)
  5 failing

  1) monops should generate a value of PI/2 for asin( 1 ):

      AssertionError: 1.5707963705062866 == 1.5707963267948966
      + expected - actual

      -1.5707963705062866
      +1.5707963267948966
      
      at Context.it (tests/gen.tests.js:202:12)

  2) monops should generate a value of PI/2 for acos(0):

      AssertionError: 1.5707963705062866 == 1.5707963267948966
      + expected - actual

      -1.5707963705062866
      +1.5707963267948966
      
      at Context.it (tests/gen.tests.js:211:12)

  3) monops should generate a value of PI/4 for atan( 1 ):

      AssertionError: 0.7853981852531433 == 0.7853981633974483
      + expected - actual

      -0.7853981852531433
      +0.7853981633974483
      
      at Context.it (tests/gen.tests.js:238:12)

  4) rate should cause a phasor with an frequency of 4410 to ramp to -.5 after five executions instead of 0:
     AssertionError: '0.50' == -0.5
      at Context.it (tests/gen.tests.js:600:12)

  5) data + peek should return the value of 49 when indexing uisng phase w/ peek:

      AssertionError: 0 == 49
      + expected - actual

      -0
      +49
      
      at Context.it (tests/gen.tests.js:629:12)


npm ERR! Test failed.  See above for more details.

danigb avatar Jan 19 '17 10:01 danigb