-
Notifications
You must be signed in to change notification settings - Fork 318
Fix EncodeDuration test expectations by matching input types #9039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: JoshLove-msft <[email protected]>
… in mockapi Co-authored-by: JoshLove-msft <[email protected]>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: JoshLove-msft <[email protected]>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
commit: |
Duration encoding tests had type mismatches between input values and expected values. In the mock framework, query parameters maintain their original type rather than being serialized to strings, causing validation failures when comparing numbers to strings.
Changes
floatSecondsLargerUnit: changed input from150.0to150and expected from"150"(string) to150(number)floatMillisecondsLargerUnit: changed input from210000.0to210000and expected from"210000"(string) to210000(number)How It Works
In the mock framework, when you set
query: { input: 150 }, the query object contains the number150, not the string"150". The validation comparesrequest.query.inputwith the expected value using strict equality (!==).Affects duration encoding tests where languages use
TimeSpan.FromMinutes(2.5)→150seconds.The fix updates the test expectations in
packages/http-specs/specs/encode/duration/mockapi.tsto ensure type consistency between mock inputs and expected validation values.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.