ncb000gt/node-cron — Issue #20: Testing breaks when seconds are based on current time but extend past 60 seconds.
Author: ncb000gt
Created: 2011-11-28 21:45:47+00:00
State: open

When run this test will sometimes pass and sometimes fail. Ultimately it depends on when the test is run.

start: 59
end: 63
✖ test every second for a range with oncomplete ([start]-[end] * * * * *)

Error: Expected 5 assertions, 1 ran
at Object.done (/Users/ncampbell/Code/node-cron/node_modules/nodeunit/lib/types.js:121:25)
at Object._onTimeout (/Users/ncampbell/Code/node-cron/tests/test-cron.js:98:14)
at Timer.ontimeout (timers.js:84:39)

This is a problem because the test is calculated based on current time and expects the test to take no more than 6 seconds. I'll have to update the test such that if it will overlap the minute it will just extend the timeout and change the start and end values.