You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
1.3 KiB

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