httpyac icon indicating copy to clipboard operation
httpyac copied to clipboard

console log of cli with error is missing current httpRegion title/ name

Open AnWeber opened this issue 2 years ago • 0 comments

Behavior is noticed in Bug: #245

Running this (same as before):

# @import ./common.http
{{
  module.exports = require('../../tests/')
}}

### Test 1
# @ref common
https://httpbin.org/status/200

{{
  tests.status.is(test, response, { val: 200 })
}}

### Test 2
POST https://httpbin.org/post
Content-Type: application/json

{{_undefinedStuff}}

{{
  tests.status.is(test, response, { val: 200 })
}}

I get this:

---------------------

=== Test common ===

GET https://httpbin.org/status/200
=> 200 (751 ms, 184 B)
✓ Status is valid

---------------------

=== Test 1 ===

GET https://httpbin.org/status/200
=> 200 (555 ms, 184 B)
✓ Status is valid
expression _undefinedStuff throws error
https://httpbin.org/post {
  protocol: 'HTTP',
  url: 'https://httpbin.org/post',
  method: 'POST',
...
  1. Run test 1:
    1. Run @ref (common) => common header + result (ok)
    2. Run test 1 => test 1 header + result (ok)
  2. Running test 2 => no header + result (error)

The order now seems fine, but the throw may prevent the proper logging of the test info.

AnWeber avatar May 05 '22 18:05 AnWeber