test_helper.js 618 B

1234567891011121314151617181920212223
  1. var helpers = require('./../lib/helpers')
  2. var extensions = function () {
  3. this.equalNumber = function (lambdaNum, num, desc) {
  4. return this.equal.call(this, helpers.toNumber(lambdaNum), num, desc)
  5. },
  6. this.isTrue = function (lambdaBool, desc) {
  7. return this.ok.call(this, helpers.toBoolean(lambdaBool), desc)
  8. },
  9. this.isFalse = function (lambdaBool, desc) {
  10. return this.ok.call(this, !helpers.toBoolean(lambdaBool), desc)
  11. }
  12. }
  13. module.exports = function (testName, testFn) {
  14. module.exports[testName] = function (test) {
  15. extensions.call(test)
  16. testFn.call(test, test)
  17. test.done()
  18. }
  19. }