twitst4tz

twitter statistics web application
Log | Files | Refs | README | LICENSE

scripts.coffee (1313B)


      1 Bluebird = require "bluebird"
      2 exec = require("child_process").execSync
      3 {assert} = require "chai"
      4 
      5 describe "scripts/initital-value.coffee (module.uptime(), expressed in milliseconds)", ->
      6   result = exec("./test/scripts/initial-value.coffee").toString().trim()
      7   it "printed #{result}", ->
      8   it "printed a value above 100", -> assert.isAbove result, 100
      9   it "printed a value below 350", -> assert.isBelow result, 350
     10 
     11 describe "scripts/delayed-require.coffee (sum of uptime and 250 ms delay`)", ->
     12   result = exec("./test/scripts/delayed-require.coffee").toString().trim()
     13   it "printed #{result}", ->
     14   it "printed a value above 350", -> assert.isAbove result, 350
     15   it "printed a value below 600", -> assert.isBelow result, 600
     16 
     17 describe "scripts/delayed-call.coffee (sum of uptime and 250 ms delay`)", ->
     18   result = exec("./test/scripts/delayed-call.coffee").toString().trim()
     19   it "printed #{result}", ->
     20   it "printed a value above 350", -> assert.isAbove result, 350
     21   it "printed a value below 600", -> assert.isBelow result, 600
     22 
     23 describe "scripts/difference.coffee", ->
     24   result = exec("./test/scripts/difference.coffee").toString().trim()
     25   it "printed #{result}", ->
     26   it "printed a value above 0.005", -> assert.isAbove result, 0.005
     27   it "printed a value below 0.07", -> assert.isBelow result, 0.07