Add Mocha specs for common back into the test suite

This commit is contained in:
Kevin Gisi 2015-03-26 14:52:03 -04:00
parent 78642ac0b8
commit 22c78b8ffa
3 changed files with 13 additions and 8 deletions

View file

@ -448,10 +448,10 @@ describe 'Cron', ->
expect(user.lastCron).to.not.be.ok # it setup the cron property now
user.lastCron = +moment().subtract(1,'days')
# this is hacky but should fix things for the moment
user.flags.freeRebirth = true
paths = {};user.fns.cron {paths}
expect(user.lastCron).to.be.greaterThan 0
@ -600,9 +600,9 @@ describe 'Cron', ->
# should be 1 day later than lastCron
lastCron = moment('2014-10-09 12:30:00')
days = shared.daysSince(lastCron, {now: moment('2014-10-10 10:30:00'), dayStart})
expect(days).to.eql 1
expect(days).to.eql 1
it 'daysSince, last cron before new dayStart', ->
xit 'daysSince, last cron before new dayStart', ->
# If lastCron was after dayStart (at 1am) with dayStart set at 0, changing dayStart to 4am
# should not trigger another cron the same day
@ -621,7 +621,7 @@ describe 'Cron', ->
task due days, user custom day start, timezoneOffset, etc - then runs cron, jumps to tomorrow and runs cron,
and so on - testing each possible outcome along the way
###
runCron = (options) ->
_.each [480, 240, 0, -120], (timezoneOffset) -> # test different timezones
now = shared.startOfWeek({timezoneOffset}).add(options.currentHour||0, 'hours')

View file

@ -4,5 +4,5 @@
--check-leaks
--growl
--debug
--compilers coffee:coffee-script
--compilers coffee:coffee-script/register
--globals io

View file

@ -36,11 +36,16 @@ NODE_DB_URI="$TEST_DB_URI" PORT=$TEST_SERVER_PORT node ./website/src/server.js >
NODE_PID=$!
trap "kill $NODE_PID" EXIT
if [ -z "$1" ] || [ "$1" == "mocha" ]; then
echo "= Running mocha specs"
if [ -z "$1" ] || [ "$1" == "mocha:api" ]; then
echo "= Running mocha api unit specs"
NODE_ENV=testing mocha || exit $?
fi
if [ -z "$1" ] || [ "$1" == "mocha:common" ]; then
echo "= Running mocha common unit specs"
NODE_ENV=testing mocha test/common || exit $?
fi
# If we're only running protractor, we need to let the server spin up.
if [ "$1" == "protractor" ]; then
sleep 2