evaluate.js 384 B

12345678910111213141516
  1. exports.assertion = function (fn, args) {
  2. this.message = 'Testing custom eval...'
  3. this.expected = true
  4. this.value = function (res) {
  5. return res.value
  6. }
  7. this.pass = function (val) {
  8. return val === this.expected
  9. }
  10. this.command = function (cb) {
  11. var self = this
  12. return this.api.execute(fn, args || [], function (res) {
  13. cb.call(self, res)
  14. })
  15. }
  16. }