Skip to content

Commit b09c34f

Browse files
CopilotMSNev
andcommitted
Use isPromiseLike helper in unload tests
Co-authored-by: MSNev <54870357+MSNev@users.noreply.github.com>
1 parent 4a1116f commit b09c34f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

AISKU/Tests/Unit/src/SnippetInitialization.Tests.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
} from "@microsoft/applicationinsights-common";
1414
import { getGlobal } from "@microsoft/applicationinsights-shims";
1515
import { 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";
1717
import { AppInsightsSku } from "../../../src/AISku";
1818

1919
const 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

Comments
 (0)