Assigning `defaults.headers.common = { 'User-Agent': ... }` replaced the
entire common headers object, nuking axios's built-in default:
Accept: application/json, text/plain, */*
This caused servers relying on content-negotiation to receive requests
with no Accept header. Fix by extending the existing object with a
property assignment instead.
Add regression tests for both electron and CLI axios instances verifying
that Accept is preserved and User-Agent is set correctly.
Co-authored-by: Pragadesh-45 <temporaryg7904@gmail.com>
* feat: add support for examples in collection items
- Enhanced the processCollectionItems function to include examples from imported collection items.
- Added a new test case to verify that examples are correctly written to the output file during collection creation.
* fix: coerce response status to number in collection creation tests
Updated the test for createCollectionFromBrunoObject to ensure the response status is compared as a number, improving type consistency in assertions.
* fix: openapi cli import
* chore: seperate bru and opencollection by a flag
* fix: pass down format correctly
* fix: pass format option correctly in collection tests
* Add opencollection version for YAML format
Set opencollection version for YAML format.
---------
Co-authored-by: Sid <siddharth@usebruno.com>
* fix(cli): preserve request type when importing collections
* fix(cli): fail fast on unsupported imported item types
* fix(cli): force BRU format when writing imported files
* chore: apply code rabbit fixes
* chore: adress review comment - keep changes minimal
* add additional test to test bru folder format
* agree with coderabbit, error handling is required
---------
Co-authored-by: Ramesh Sunkara <rs@rsunkara.com>
* feat: enhance json environment file support in bruno-cli
feat: add parseEnvironmentJson function to normalize environment JSON structure
lint fixes
feat: added tests for invalid JSON environment files in CLI and added missing constant defenition.
feat: improve JSON environment file handling and update tests
Trigger test
fix: update CLI command syntax for non-existent JSON environment file test
fix: correct CLI command syntax in test for non-existent JSON environment file
fix: update CLI command syntax in test for non-existent JSON environment file
fix: update test to use temporary path for non-existent JSON environment file
trying to fix the tests
fix tests
refactor: rename ERROR_INVALID_JSON to ERROR_INVALID_FILE and update related error handling in CLI commands and tests
fix: update parseEnvironmentJson to preserve secret flag
test: improved tests
* refactor: move parseEnvironmentJson function to utils/ environment.js file and update imports
* test: update tests
* fix: improve file upload handling in prepare-request to use streaming
* feat: add unit tests
---------
Co-authored-by: Bijin Bruno <bijin@usebruno.com>
Co-authored-by: William Quintal <william95quintalwilliam@outlook.com>
Feat: Enhance run command to accept multiple inputs for requests and folders in Bruno CLI (Improves: #2956) (Fixes: #2955)