I am writing a node app using coffeescript and doing some TDD using mocha.js. Please can someone point me correct way to write the test.
What I want to do: Fake response of 'ra.do_get'and then call method 'all_tests' to analyze return value
var ra = require('./request_adapter');
class QueryHandler
constructor: (@adapter) ->
@klass = "QueryHandler"
@url = "http://localhost:#{port[@adapter]}/"
logger.debug "[#{@klass}] creating .."
all_tests: (cb) ->
logger.info "#{@adapter}: requesting all test - #{adapter_apis.ALL_TESTS_SESSION}"
//RequestAdapter is another class doing some GET/POST etc (using request NPM)
ra = new RequestAdapter(@url)
_url = @url + adapter_apis.ALL_TESTS_SESSION
ra.do_get _url, (error , response) ->
if error
return cb({error: true, message: "#{@adapter} adapter errored out"})
else
return cb(null,response)
return Thanks
--
You received this message because you are subscribed to the Google Groups "Sinon.JS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sinonjs+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.