2

I would like o introduce to should assert library, working for tests of my node.js app, my additional functions.

Something like in this pseudocode

should      = require "should"

myExists = (obj, msg) ->
  # my special exist logic

containSomething = (obj, msg) ->
  # my special assert logic

should.myExists = myExists
should.containSomething = containSomething


describe.only "`my extra `", ->
   it 'should be working', (done) ->
     obj = {}
     obj.should.myExists  
     obj.should.not.myExists  
     obj.should.containSomething {cool:obj}
     obj.should.not.containSomething {cool:obj}
     done()

Any suggestions how to do that in practice?

Luman75
  • 878
  • 1
  • 11
  • 28

1 Answers1

0
should.myExits = myExists

should probably be

should.myExist = myExists
Ben McCormick
  • 25,260
  • 12
  • 52
  • 71
  • this is not about typo problem ( I put a pseudo code) but it's about extending Object with new methods. – Luman75 Aug 30 '13 at 08:34