jlongster / js-csp

CSP channels for Javascript (like Clojurescript's core.async, or Go) THIS IS AN UPSTREAM FORK
281 stars 9 forks source link

Your fork fails the tests #2

Open evandrix opened 10 years ago

evandrix commented 10 years ago

I get plenty of errors trying to make your fork, as compared to the original github repo.

npm install
./node_modules/mocha/bin/mocha --harmony --ui exports --reporter spec
  Fixed buffer
    ✓ should work 

  Dropping buffer
    ✓ should work 

  Sliding buffer
    ✓ should work 

  put
    that is immediate
      1) should return true if value is taken
      2) should return true if value is buffered
      3) should return false if channel is already closed
    that is parked
      4) should return true if value is then taken
      5) should return false if channel is then closed
      ✓ should be moved to the buffer when a value is taken from it 

  take
    that is immediate
      6) should return correct value that was directly put
      7) should return correct value that was buffered
      8) should return false if channel is already closed
    that is parked
      9) should return correct value if it is then delivered
      10) should return CLOSED if channel is then closed

  alts
    11) should work with identity channel
    default value
      12) "before all" hook

  4 passing (76ms)
  12 failing

  1) put that is immediate should return true if value is taken:
     Uncaught TypeError: undefined is not a function
      at $HOME/js-csp/src/csp.test-helpers.js:36:7
      at GeneratorFunctionPrototype.next (native)
      at Process.run ($HOME/js-csp/src/impl/process.js:99:30)
      at $HOME/js-csp/src/impl/process.js:67:10
      at Immediate.process_messages [as _onImmediate] ($HOME/js-csp/src/impl/dispatch.js:36:5)
      at processImmediate [as _immediateCallback] (timers.js:374:17)

  2) put that is immediate should return true if value is buffered:
     Uncaught TypeError: undefined is not a function
      at $HOME/js-csp/src/csp.test-helpers.js:36:7
      at GeneratorFunctionPrototype.next (native)
      at Process.run ($HOME/js-csp/src/impl/process.js:99:30)
      at $HOME/js-csp/src/impl/process.js:67:10
      at Immediate.process_messages [as _onImmediate] ($HOME/js-csp/src/impl/dispatch.js:36:5)
      at processImmediate [as _immediateCallback] (timers.js:374:17)

  3) put that is immediate should return false if channel is already closed:
     Uncaught TypeError: undefined is not a function
      at $HOME/js-csp/src/csp.test-helpers.js:36:7
      at GeneratorFunctionPrototype.next (native)
      at Process.run ($HOME/js-csp/src/impl/process.js:99:30)
      at $HOME/js-csp/src/impl/process.js:67:10
      at Immediate.process_messages [as _onImmediate] ($HOME/js-csp/src/impl/dispatch.js:36:5)
      at processImmediate [as _immediateCallback] (timers.js:374:17)

  4) put that is parked should return true if value is then taken:
     TypeError: undefined is not a function
      at $HOME/js-csp/src/csp.test-helpers.js:36:7
      at GeneratorFunctionPrototype.next (native)
      at Process.run ($HOME/js-csp/src/impl/process.js:99:30)
      at newProcess ($HOME/js-csp/src/csp.core.js:23:8)
      at go ($HOME/js-csp/src/csp.core.js:32:10)
      at Context.<anonymous> ($HOME/js-csp/src/csp.test-helpers.js:25:5)
      at Test.Runnable.run ($HOME/js-csp/node_modules/mocha/lib/runnable.js:204:15)
      at Runner.runTest ($HOME/js-csp/node_modules/mocha/lib/runner.js:374:10)
      at $HOME/js-csp/node_modules/mocha/lib/runner.js:452:12
      at next ($HOME/js-csp/node_modules/mocha/lib/runner.js:299:14)
      at $HOME/js-csp/node_modules/mocha/lib/runner.js:309:7
      at next ($HOME/js-csp/node_modules/mocha/lib/runner.js:247:23)
      at Immediate._onImmediate ($HOME/js-csp/node_modules/mocha/lib/runner.js:276:5)
      at processImmediate [as _immediateCallback] (timers.js:374:17)

  5) put that is parked should return false if channel is then closed:
     TypeError: undefined is not a function
      at $HOME/js-csp/src/csp.test-helpers.js:36:7
      at GeneratorFunctionPrototype.next (native)
      at Process.run ($HOME/js-csp/src/impl/process.js:99:30)
      at newProcess ($HOME/js-csp/src/csp.core.js:23:8)
      at go ($HOME/js-csp/src/csp.core.js:32:10)
      at Context.<anonymous> ($HOME/js-csp/src/csp.test-helpers.js:25:5)
      at Test.Runnable.run ($HOME/js-csp/node_modules/mocha/lib/runnable.js:204:15)
      at Runner.runTest ($HOME/js-csp/node_modules/mocha/lib/runner.js:374:10)
      at $HOME/js-csp/node_modules/mocha/lib/runner.js:452:12
      at next ($HOME/js-csp/node_modules/mocha/lib/runner.js:299:14)
      at $HOME/js-csp/node_modules/mocha/lib/runner.js:309:7
      at next ($HOME/js-csp/node_modules/mocha/lib/runner.js:247:23)
      at Immediate._onImmediate ($HOME/js-csp/node_modules/mocha/lib/runner.js:276:5)
      at processImmediate [as _immediateCallback] (timers.js:374:17)

  6) take that is immediate should return correct value that was directly put:
     Uncaught TypeError: undefined is not a function
      at $HOME/js-csp/src/csp.test-helpers.js:36:7
      at GeneratorFunctionPrototype.next (native)
      at Process.run ($HOME/js-csp/src/impl/process.js:99:30)
      at $HOME/js-csp/src/impl/process.js:67:10
      at Immediate.process_messages [as _onImmediate] ($HOME/js-csp/src/impl/dispatch.js:36:5)
      at processImmediate [as _immediateCallback] (timers.js:374:17)

  7) take that is immediate should return correct value that was buffered:
     Uncaught TypeError: undefined is not a function
      at $HOME/js-csp/src/csp.test-helpers.js:36:7
      at GeneratorFunctionPrototype.next (native)
      at Process.run ($HOME/js-csp/src/impl/process.js:99:30)
      at $HOME/js-csp/src/impl/process.js:67:10
      at Immediate.process_messages [as _onImmediate] ($HOME/js-csp/src/impl/dispatch.js:36:5)
      at processImmediate [as _immediateCallback] (timers.js:374:17)

  8) take that is immediate should return false if channel is already closed:
     Uncaught TypeError: undefined is not a function
      at $HOME/js-csp/src/csp.test-helpers.js:36:7
      at GeneratorFunctionPrototype.next (native)
      at Process.run ($HOME/js-csp/src/impl/process.js:99:30)
      at $HOME/js-csp/src/impl/process.js:67:10
      at Immediate.process_messages [as _onImmediate] ($HOME/js-csp/src/impl/dispatch.js:36:5)
      at processImmediate [as _immediateCallback] (timers.js:374:17)

  9) take that is parked should return correct value if it is then delivered:
     TypeError: undefined is not a function
      at $HOME/js-csp/src/csp.test-helpers.js:36:7
      at GeneratorFunctionPrototype.next (native)
      at Process.run ($HOME/js-csp/src/impl/process.js:99:30)
      at newProcess ($HOME/js-csp/src/csp.core.js:23:8)
      at go ($HOME/js-csp/src/csp.core.js:32:10)
      at Context.<anonymous> ($HOME/js-csp/src/csp.test-helpers.js:25:5)
      at Test.Runnable.run ($HOME/js-csp/node_modules/mocha/lib/runnable.js:204:15)
      at Runner.runTest ($HOME/js-csp/node_modules/mocha/lib/runner.js:374:10)
      at $HOME/js-csp/node_modules/mocha/lib/runner.js:452:12
      at next ($HOME/js-csp/node_modules/mocha/lib/runner.js:299:14)
      at $HOME/js-csp/node_modules/mocha/lib/runner.js:309:7
      at next ($HOME/js-csp/node_modules/mocha/lib/runner.js:247:23)
      at Immediate._onImmediate ($HOME/js-csp/node_modules/mocha/lib/runner.js:276:5)
      at processImmediate [as _immediateCallback] (timers.js:374:17)

  10) take that is parked should return CLOSED if channel is then closed:
     TypeError: undefined is not a function
      at $HOME/js-csp/src/csp.test-helpers.js:36:7
      at GeneratorFunctionPrototype.next (native)
      at Process.run ($HOME/js-csp/src/impl/process.js:99:30)
      at newProcess ($HOME/js-csp/src/csp.core.js:23:8)
      at go ($HOME/js-csp/src/csp.core.js:32:10)
      at Context.<anonymous> ($HOME/js-csp/src/csp.test-helpers.js:25:5)
      at Test.Runnable.run ($HOME/js-csp/node_modules/mocha/lib/runnable.js:204:15)
      at Runner.runTest ($HOME/js-csp/node_modules/mocha/lib/runner.js:374:10)
      at $HOME/js-csp/node_modules/mocha/lib/runner.js:452:12
      at next ($HOME/js-csp/node_modules/mocha/lib/runner.js:299:14)
      at $HOME/js-csp/node_modules/mocha/lib/runner.js:309:7
      at next ($HOME/js-csp/node_modules/mocha/lib/runner.js:247:23)
      at Immediate._onImmediate ($HOME/js-csp/node_modules/mocha/lib/runner.js:276:5)
      at processImmediate [as _immediateCallback] (timers.js:374:17)

  11) alts should work with identity channel:
     Uncaught TypeError: undefined is not a function
      at $HOME/js-csp/src/csp.test-helpers.js:36:7
      at GeneratorFunctionPrototype.next (native)
      at Process.run ($HOME/js-csp/src/impl/process.js:99:30)
      at $HOME/js-csp/src/impl/process.js:67:10
      at Immediate.process_messages [as _onImmediate] ($HOME/js-csp/src/impl/dispatch.js:36:5)
      at processImmediate [as _immediateCallback] (timers.js:374:17)

  12) alts default value "before all" hook:
     Uncaught TypeError: undefined is not a function
      at $HOME/js-csp/src/csp.test-helpers.js:36:7
      at GeneratorFunctionPrototype.next (native)
      at Process.run ($HOME/js-csp/src/impl/process.js:99:30)
      at $HOME/js-csp/src/impl/process.js:67:10
      at Immediate.process_messages [as _onImmediate] ($HOME/js-csp/src/impl/dispatch.js:36:5)
      at processImmediate [as _immediateCallback] (timers.js:374:17)

make: *** [test] Error 12
jlongster commented 10 years ago

Yes, this is an early fork. It isn't quite ready for production yet but it won't take long to polish it up. The main thing I need to do is talk with the original author and see if he's still interested in maintaining it.

I'd say in a matter of weeks this will be ready for production.