我想介绍一下应该断言库,用于测试我的 node.js 应用程序,我的附加功能。
这个伪代码中的东西
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()
任何建议如何在实践中做到这一点?