@@ -13,7 +13,7 @@ import {
1313} from "@microsoft/applicationinsights-common" ;
1414import { getGlobal } from "@microsoft/applicationinsights-shims" ;
1515import { TelemetryContext } from "@microsoft/applicationinsights-properties-js" ;
16- import { dumpObj , objHasOwnProperty , strSubstring } from "@nevware21/ts-utils" ;
16+ import { dumpObj , isPromiseLike , objHasOwnProperty , strSubstring } from "@nevware21/ts-utils" ;
1717import { AppInsightsSku } from "../../../src/AISku" ;
1818
1919const TestInstrumentationKey = 'b7170927-2d1c-44f1-acec-59f4e1751c11' ;
@@ -1025,7 +1025,7 @@ export class SnippetInitializationTests extends AITestClass {
10251025 let theSnippet = this . _initializeSnippet ( snippetCreator ( getSnippetConfig ( this . sessionPrefix ) ) ) ;
10261026 const result = theSnippet . unload ( ) ;
10271027 Assert . ok ( result , "unload() should return a promise when called without parameters" ) ;
1028- Assert . ok ( typeof result . then === 'function' , "returned value should be promise-like" ) ;
1028+ Assert . ok ( isPromiseLike ( result ) , "returned value should be promise-like" ) ;
10291029
10301030 // Wait for the promise to resolve
10311031 return result ;
@@ -1041,7 +1041,7 @@ export class SnippetInitializationTests extends AITestClass {
10411041 let theSnippet = this . _initializeSnippet ( snippetCreator ( getSnippetConfig ( this . sessionPrefix ) ) ) ;
10421042 const result = theSnippet . unload ( true ) ;
10431043 Assert . ok ( result , "unload(true) should return a promise" ) ;
1044- Assert . ok ( typeof result . then === 'function' , "returned value should be promise-like" ) ;
1044+ Assert . ok ( isPromiseLike ( result ) , "returned value should be promise-like" ) ;
10451045
10461046 // Wait for the promise to resolve
10471047 return result ;
0 commit comments