API requests in tests to https://localhost doesn't work with test:node but it works with test:browser #30215
Labels
Azure.Core
Client
This issue points to a problem in the data-plane of the library.
needs-author-feedback
Workflow: More information is needed from author to address the issue.
no-recent-activity
There has been no recent activity on this issue.
vitest.browser.shared.config.ts
Describe the bug
I have a local setup where our service runs on https://localhost/. I have written test cases that make REST API calls to this service.
These tests fail when executed in a Node.js environment, but they pass when run in a browser environment. If I use a real endpoint not localhost both node and browser test cases are passing.
Client configuration:
API call:
The error I get if I use
dev-tool run test:vitest
The same test with the same setup passes if I use
dev-tool run test:vitest --browser
To Reproduce
Steps to reproduce the behavior:
dev-tool run test:vitest
.Expected behavior
The test cases should have the same behavior on both node and browser environments
Screenshots
N/A
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: