Test output order incorrect when using ref requests
See original GitHub issuecommon.http
{{
module.exports = require('../../tests/')
}}
### Test common
# @name common
https://httpbin.org/status/200
{{
tests.status.is(test, response, { val: 200 })
}}
245.http
# @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 })
}}
Execution
Running:
httpyac --all ./requests/bugs/245.http --output short
We get:
---------------------
=== Test common ===
GET https://httpbin.org/status/200
=> 200 (741 ms, 184 B)
✓ Status is valid
✓ Status is valid
---------------------
=== Test 1 ===
GET https://httpbin.org/status/200
=> 200 (530 ms, 184 B)
expression _undefinedStuff throws error
ReferenceError: _undefinedStuff is not defined
at Object.<anonymous> (/httpyac-experiments/requests/bugs/245.http:19:20)
at yt (/.nvm/versions/node/v17.3.1/lib/node_modules/httpyac/dist/index.js:3:40858)
at Vt (/.nvm/versions/node/v17.3.1/lib/node_modules/httpyac/dist/index.js:3:41400)
at /.nvm/versions/node/v17.3.1/lib/node_modules/httpyac/dist/index.js:3:44177
at ee (/.nvm/versions/node/v17.3.1/lib/node_modules/httpyac/dist/index.js:2:30407)
at Object.li [as action] (/.nvm/versions/node/v17.3.1/lib/node_modules/httpyac/dist/index.js:3:44142)
at qt.<anonymous> (/.nvm/versions/node/v17.3.1/lib/node_modules/httpyac/node_modules/hookpoint/dist/index.js:1:2762)
at Generator.next (<anonymous>)
at u (/.nvm/versions/node/v17.3.1/lib/node_modules/httpyac/node_modules/hookpoint/dist/index.js:1:1262)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
---------------------
=== Test 2 ===
POST https://httpbin.org/post
=> 200 (999 ms, 627 B)
✓ Status is valid
3 requests tested (3 succeeded, 0 failed)
There are 2 issues I can see here:
test common
has the result of its own test, plus the test of the request which is referencing itTest 1
does not have the result of its own test (see1
above), but instead does have an error related toTest 2
As a side note… I wonder if execution should be abandoned on throw… 🤔
Sorry to always be the bearer of bad news… 😇
Issue Analytics
- State:
- Created a year ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Common mistakes with React Testing Library
Hi there I created React Testing Library because I wasn't satisfied with the testing landscape at the time. It expanded to DOM Testing...
Read more >Best practices for writing unit tests - .NET
Learn best practices for writing unit tests that drive code quality and resilience for .NET Core and .NET Standard projects.
Read more >REST API Testing Strategy: What Exactly Should You Test?
The API layer of any application is one of the most crucial software components. Here's a technical look at how we test our...
Read more >COMMON ERRORS IN KRONOS AND HOW TO FIX THEM
Incorrectly recording overtime hours. Non-exempt employees who have approval to work overtime should record their total hours worked each day without using ......
Read more >Unit Tests, How to Write Testable Code, and Why It Matters
Verifying that the system under test produces correct results, or that its resulting state is correct, is called state-based unit testing, while verifying...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@gerukin I agree with you that in case of error it would be better to output the title as well. I just don’t have a nice solution yet. I’ll create my own ticket to make it more visible again.
@gerukin I think your problem here is still the lack of output that Test2 is currently running. Correct?