-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[test][ai-metrics-advisor] replace assert.ok with specific assertions #36402
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR replaces assert.ok() with assert.isDefined() throughout test files in the metrics advisor SDK. The change improves test assertion clarity by using a more specific assertion method that explicitly checks if a value is not undefined or null, rather than relying on truthiness checks.
Key Changes
- Replaced all instances of
assert.ok()withassert.isDefined()for checking if values exist - Reformatted some multi-line assertion calls for better code consistency
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 21 comments.
Show a summary per file
| File | Description |
|---|---|
| hookTests.spec.ts | Updated assertions for hook creation and hook listing tests to use isDefined |
| datafeed.spec.ts | Updated assertions for data feed creation, updates, and listing operations to use isDefined |
| dataSourceCred.spec.ts | Updated assertions for data source credential operations to use isDefined |
| advisorclient.spec.ts | Updated assertions for anomaly detection, alerts, feedback, and metric operations to use isDefined |
| adminclient.spec.ts | Updated assertions for ingestion status, detection configs, and alert config operations to use isDefined |
sdk/metricsadvisor/ai-metrics-advisor/test/public/adminclient.spec.ts
Outdated
Show resolved
Hide resolved
sdk/metricsadvisor/ai-metrics-advisor/test/public/advisorclient.spec.ts
Outdated
Show resolved
Hide resolved
sdk/metricsadvisor/ai-metrics-advisor/test/public/advisorclient.spec.ts
Outdated
Show resolved
Hide resolved
sdk/metricsadvisor/ai-metrics-advisor/test/public/advisorclient.spec.ts
Outdated
Show resolved
Hide resolved
sdk/metricsadvisor/ai-metrics-advisor/test/public/advisorclient.spec.ts
Outdated
Show resolved
Hide resolved
sdk/metricsadvisor/ai-metrics-advisor/test/public/advisorclient.spec.ts
Outdated
Show resolved
Hide resolved
sdk/metricsadvisor/ai-metrics-advisor/test/public/advisorclient.spec.ts
Outdated
Show resolved
Hide resolved
sdk/metricsadvisor/ai-metrics-advisor/test/public/advisorclient.spec.ts
Outdated
Show resolved
Hide resolved
sdk/metricsadvisor/ai-metrics-advisor/test/public/advisorclient.spec.ts
Outdated
Show resolved
Hide resolved
sdk/metricsadvisor/ai-metrics-advisor/test/public/advisorclient.spec.ts
Outdated
Show resolved
Hide resolved
39265e5 to
ed70262
Compare
No description provided.