コード例 #1
0
 }, function () {
   hacktrace({
     file: example.parent.filename,
     label: 'Response: ' + example.title,
     line: example.markdown.token.line
   }, assertion)
 })
コード例 #2
0
 function addTest(title, assertion) {
   debug('addTest', title)
   var test = example.addTest({ title: title })
     , prev = example.context.request.example
   try {
     hacktrace({
       file: prev.parent.filename,
       label: prev.title,
       line: prev.markdown.token.line
     }, function () {
       hacktrace({
         file: example.parent.filename,
         label: 'Response: ' + example.title,
         line: example.markdown.token.line
       }, assertion)
     })
     debug('succeeded')
     test.ok()
   } catch(e) {
     debug('failed: ', e)
     example.fail = true
     e.stack = e.hacktrace()
     test.fail(e)
   }
 }