@@ -40,9 +40,9 @@ matrix([[true, false]] as const, async (useAad) => {
4040 new Date ( Date . UTC ( 2021 , 10 , 1 ) ) ,
4141 ) ;
4242 let result = getYieldedValue ( await iterator . next ( ) ) ;
43- assert . ok ( result . status , "Expecting first status" ) ;
43+ assert . isDefined ( result . status , "Expecting first status" ) ;
4444 result = getYieldedValue ( await iterator . next ( ) ) ;
45- assert . ok ( result . status , "Expecting second status" ) ;
45+ assert . isDefined ( result . status , "Expecting second status" ) ;
4646 } ) ;
4747
4848 it ( "lists ingestion status with datetime strings" , async ( ) => {
@@ -52,9 +52,9 @@ matrix([[true, false]] as const, async (useAad) => {
5252 "2021-11-01T00:00:00.000Z" ,
5353 ) ;
5454 let result = getYieldedValue ( await iterator . next ( ) ) ;
55- assert . ok ( result . status , "Expecting first status" ) ;
55+ assert . isDefined ( result . status , "Expecting first status" ) ;
5656 result = getYieldedValue ( await iterator . next ( ) ) ;
57- assert . ok ( result . status , "Expecting second status" ) ;
57+ assert . isDefined ( result . status , "Expecting second status" ) ;
5858 } ) ;
5959
6060 it ( "lists ingestion status by page" , async ( ) => {
@@ -76,8 +76,11 @@ matrix([[true, false]] as const, async (useAad) => {
7676 assertEnvironmentVariable ( "METRICS_ADVISOR_AZURE_SQLSERVER_DATAFEED_ID" ) ,
7777 ) ;
7878
79- assert . ok ( result . latestSuccessTimestamp , "Expecting valid latest success timestamp" ) ;
80- assert . ok ( result . latestActiveTimestamp , "Expecting valid latest active timestamp" ) ;
79+ assert . isDefined (
80+ result . latestSuccessTimestamp ,
81+ "Expecting valid latest success timestamp" ,
82+ ) ;
83+ assert . isDefined ( result . latestActiveTimestamp , "Expecting valid latest active timestamp" ) ;
8184 } ) ;
8285
8386 it ( "refreshes ingesetion status" , async ( ctx ) => {
@@ -140,7 +143,7 @@ matrix([[true, false]] as const, async (useAad) => {
140143
141144 const actual = await client . createDetectionConfig ( expected ) ;
142145
143- assert . ok ( actual . id , "Expecting valid detection config" ) ;
146+ assert . isDefined ( actual . id , "Expecting valid detection config" ) ;
144147 createdDetectionConfigId = actual . id ! ;
145148
146149 assert . equal ( actual . name , expected . name ) ;
@@ -204,7 +207,7 @@ matrix([[true, false]] as const, async (useAad) => {
204207 } ;
205208
206209 const actual = await client . updateDetectionConfig ( createdDetectionConfigId , expected ) ;
207- assert . ok ( actual . id , "Expecting valid detection config" ) ;
210+ assert . isDefined ( actual . id , "Expecting valid detection config" ) ;
208211 createdDetectionConfigId = actual . id ! ;
209212
210213 assert . equal ( actual . name , expected . name ) ;
@@ -213,7 +216,7 @@ matrix([[true, false]] as const, async (useAad) => {
213216 actual . wholeSeriesDetectionCondition ,
214217 expected . wholeSeriesDetectionCondition ,
215218 ) ;
216- assert . ok (
219+ assert . isDefined (
217220 actual . seriesGroupDetectionConditions ,
218221 "Expecting valid seriesGroupDetectionConditions" ,
219222 ) ;
@@ -225,7 +228,10 @@ matrix([[true, false]] as const, async (useAad) => {
225228 actual . seriesGroupDetectionConditions ! [ 0 ] . hardThresholdCondition ,
226229 expected . seriesGroupDetectionConditions ! [ 0 ] . hardThresholdCondition ,
227230 ) ;
228- assert . ok ( actual . seriesDetectionConditions , "Expecting valid seriesDetectionConditions" ) ;
231+ assert . isDefined (
232+ actual . seriesDetectionConditions ,
233+ "Expecting valid seriesDetectionConditions" ,
234+ ) ;
229235 delete ( actual . seriesDetectionConditions ! [ 0 ] . seriesKey as any ) . seriesId ; // workaround service issue
230236 assert . deepStrictEqual (
231237 actual . seriesDetectionConditions ! [ 0 ] . seriesKey ,
@@ -249,9 +255,9 @@ matrix([[true, false]] as const, async (useAad) => {
249255 assertEnvironmentVariable ( "METRICS_ADVISOR_AZURE_SQLSERVER_METRIC_ID_1" ) ,
250256 ) ;
251257 let result = getYieldedValue ( await iterator . next ( ) ) ;
252- assert . ok ( result . id , "Expecting first detection config" ) ;
258+ assert . isDefined ( result . id , "Expecting first detection config" ) ;
253259 result = getYieldedValue ( await iterator . next ( ) ) ;
254- assert . ok ( result . id , "Expecting second detection config" ) ;
260+ assert . isDefined ( result . id , "Expecting second detection config" ) ;
255261 } ) ;
256262
257263 it ( "lists detection configurations by page" , async ( ) => {
@@ -261,7 +267,7 @@ matrix([[true, false]] as const, async (useAad) => {
261267 )
262268 . byPage ( ) ;
263269 const result = await iterator . next ( ) ;
264- assert . ok ( result . value . length > 1 , "Expecting more than one entries in page" ) ;
270+ assert . isTrue ( result . value . length > 1 , "Expecting more than one entries in page" ) ;
265271 } ) ;
266272
267273 let expectedAlertConfigName : string ;
@@ -284,7 +290,7 @@ matrix([[true, false]] as const, async (useAad) => {
284290
285291 const actual = await client . createAlertConfig ( expectedAlertConfig ) ;
286292
287- assert . ok ( actual . id , "Expecting valid alert config" ) ;
293+ assert . isDefined ( actual . id , "Expecting valid alert config" ) ;
288294 createdAlertConfigId = actual . id ;
289295 assert . equal ( actual . name , expectedAlertConfig . name ) ;
290296 assert . equal ( actual . description , expectedAlertConfig . description ) ;
@@ -303,7 +309,7 @@ matrix([[true, false]] as const, async (useAad) => {
303309 it ( "retrieves an alert configuration" , async ( ) => {
304310 const actual = await client . getAlertConfig ( createdAlertConfigId ) ;
305311
306- assert . ok ( actual . id , "Expecting valid alert config" ) ;
312+ assert . isDefined ( actual . id , "Expecting valid alert config" ) ;
307313 createdAlertConfigId = actual . id ;
308314 assert . equal ( actual . name , expectedAlertConfigName ) ;
309315 } ) ;
@@ -328,7 +334,7 @@ matrix([[true, false]] as const, async (useAad) => {
328334 } ;
329335
330336 const actual = await client . updateAlertConfig ( createdAlertConfigId , patch ) ;
331- assert . ok ( actual . id , "Expecting valid alerting config" ) ;
337+ assert . isDefined ( actual . id , "Expecting valid alerting config" ) ;
332338 assert . equal ( actual . name , "new alert config name" ) ;
333339 assert . equal ( actual . description , "new alert config description" ) ;
334340 assert . equal ( actual . crossMetricsOperator , "OR" ) ;
@@ -360,9 +366,9 @@ matrix([[true, false]] as const, async (useAad) => {
360366 try {
361367 const iterator = client . listAlertConfigs ( createdDetectionConfigId ) ;
362368 let result = getYieldedValue ( await iterator . next ( ) ) ;
363- assert . ok ( result . id , "Expecting first alert config" ) ;
369+ assert . isDefined ( result . id , "Expecting first alert config" ) ;
364370 result = getYieldedValue ( await iterator . next ( ) ) ;
365- assert . ok ( result . id , "Expecting second alert config" ) ;
371+ assert . isDefined ( result . id , "Expecting second alert config" ) ;
366372 const pageIterator = client . listAlertConfigs ( createdDetectionConfigId ) . byPage ( ) ;
367373 const pageResult = await pageIterator . next ( ) ;
368374 assert . isTrue ( pageResult . value . length > 1 , "Expecting more than one entries in page" ) ;
0 commit comments