ApplicationInsights-JS icon indicating copy to clipboard operation
ApplicationInsights-JS copied to clipboard

Update Async Tests Under AISKU to Use the Modern AsyncQueue Pattern

Open Karlie-777 opened this issue 6 months ago • 0 comments

updates all async unit tests in the AISKU directory to use the modern asyncQueue pattern instead of the deprecated testCaseAsync. reference link https://github.com/microsoft/ApplicationInsights-JS/pull/2544 Example of the Pattern Change: before:

this.testCaseAsync({
    name: "Test name",
    stepDelay: 1,
    useFakeTimers: true,
    steps: [() => {
        // Test setup
        // ...
    }].concat(this.waitForException(1))
    .concat(() => {
        // Assertions
        // ...
    })
});

after:

this.testCase({
    name: "Test name",
    useFakeTimers: true,
    test: () => {
        return this._asyncQueue().add(() => {
            // Test setup
            // ...
        })
        .concat(this.waitForException(1))
        .add(() => {
            // Assertions
            // ...
        });
    }
});

Karlie-777 avatar Jul 07 '25 20:07 Karlie-777