【发布时间】:2011-09-05 09:11:48
【问题描述】:
如何测试这样的函数?
app.post '/incoming', (req,res) ->
console.log "Hello, incoming call!"
message = req.body.Body
from = req.body.From
sys.log "From: " + from + ", Message: " + message
twiml = '<?xml version="1.0" encoding="UTF-8" ?>\n<Response>\n<Say>Thanks for your text, we\'ll be in touch.</Say>\n</Response>'
res.send twiml, {'Content-Type':'text/xml'}, 200
我还没有选择任何测试框架。我不明白如何测试。
谢谢!
【问题讨论】:
标签: javascript node.js coffeescript