Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it(`respects the millis configuration option`, async () => {
singleSpa.setUnmountMaxTime(5, false, 1000);
await controlledParcelActions(unmount, "unmount-0", 0, 0, 0, 3);
expect(consoleErrSpy).not.toHaveBeenCalled();
await controlledParcelActions(unmount, "unmount-1", 0, 0, 0, 10);
expectError(
`single-spa minified message #31: Lifecycle function unmount for parcel unmount-1 lifecycle did not resolve or reject for 5 ms. See https://single-spa.js.org/error/?code=31&arg=unmount&arg=parcel&arg=unmount-1&arg=5`
);
});
it(`respects warningMillis configuration option`, async () => {
singleSpa.setUnmountMaxTime(15, false, 5);
await controlledParcelActions(unmount, "unmount-2", 0, 0, 0, 3);
expect(consoleWarnSpy).not.toHaveBeenCalled();
await controlledParcelActions(unmount, "unmount-3", 0, 0, 0, 10);
expectWarning(
`single-spa minified message #31: Lifecycle function unmount for parcel unmount-3 lifecycle did not resolve or reject for 15 ms. See https://single-spa.js.org/error/?code=31&arg=unmount&arg=parcel&arg=unmount-3&arg=15`
);
});
});
afterEach(() => {
singleSpa.setUnmountMaxTime(5000, false, 1000);
});