How to use the single-spa.setBootstrapMaxTime function in single-spa

To help you get started, we’ve selected a few single-spa examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CanopyTax / single-spa / spec / apis / timeout-apis.spec.js View on Github external
it(`respects the millis configuration option`, async () => {
      singleSpa.setBootstrapMaxTime(5, false, 1000);

      await controlledParcelActions(
        parcel => parcel.bootstrapPromise,
        "bootstrap-0",
        3
      );
      expect(consoleErrSpy).not.toHaveBeenCalled();

      await controlledParcelActions(
        parcel => parcel.bootstrapPromise,
        "bootstrap-1",
        10
      );
      expectError(
        `single-spa minified message #31: Lifecycle function bootstrap for parcel bootstrap-1 lifecycle did not resolve or reject for 5 ms. See https://single-spa.js.org/error/?code=31&arg=bootstrap&arg=parcel&arg=bootstrap-1&arg=5`
      );
github CanopyTax / single-spa / spec / apis / timeout-apis.spec.js View on Github external
it(`respects warningMillis configuration option`, async () => {
      singleSpa.setBootstrapMaxTime(15, false, 5);

      await controlledParcelActions(
        parcel => parcel.bootstrapPromise,
        "bootstrap-2",
        0
      );
      expect(consoleWarnSpy).not.toHaveBeenCalled();

      await controlledParcelActions(
        parcel => parcel.bootstrapPromise,
        "bootstrap-3",
        10
      );
      expectWarning(
        `single-spa minified message #31: Lifecycle function bootstrap for parcel bootstrap-3 lifecycle did not resolve or reject for 15 ms. See https://single-spa.js.org/error/?code=31&arg=bootstrap&arg=parcel&arg=bootstrap-3&arg=15`
      );
github CanopyTax / single-spa / spec / apis / timeout-apis.spec.js View on Github external
afterEach(() => {
      singleSpa.setBootstrapMaxTime(5000, false, 1000);
    });