ApplicationInsights-JS
ApplicationInsights-JS copied to clipboard
Update Async Tests Under AISKU to Use the Modern AsyncQueue Pattern
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
// ...
});
}
});