How to use the single-spa.NOT_BOOTSTRAPPED 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 / parcels / mount-root-parcel.spec.js View on Github external
it(`doesn't resolve bootstrapPromise, mountPromise, or unmountPromise with any values`, () => {
    const parcelConfig = createParcelConfig();
    const parcel = singleSpa.mountRootParcel(parcelConfig, {domElement: document.createElement('div')});
    expect(parcel.getStatus()).toBe(singleSpa.NOT_BOOTSTRAPPED);

    return parcel
      .bootstrapPromise
      .then(value => {
        expect(value).toBe(null);
        return parcel.mountPromise;
      })
      .then(value => {
        expect(value).toBe(null);
        return Promise.all([
          parcel.unmountPromise,
          parcel.unmount(),
        ]);
      })
      .then(values => {
        const [unmountPromiseValue, unmountValue] = values;
github CanopyTax / single-spa / spec / parcels / mount-root-parcel.spec.js View on Github external
it(`can mount and unmount root parcels`, () => {
    const parcelConfig = createParcelConfig();
    const parcel = singleSpa.mountRootParcel(parcelConfig, {domElement: document.createElement('div')});
    expect(parcel.getStatus()).toBe(singleSpa.NOT_BOOTSTRAPPED);

    return parcel
      .mountPromise
      .then(() => {
        expect(parcel.getStatus()).toBe(singleSpa.MOUNTED);
      })
      .then(() => new Promise((resolve, reject) => {
        setTimeout(resolve, 20);
      }))
      .then(parcel.unmount)
      .then(() => {
        expect(parcel.getStatus()).toBe(singleSpa.NOT_MOUNTED);
      })
  });
github CanopyTax / single-spa / spec / apps / invalid-load-function / invalid-load-function.spec.js View on Github external
.then(() => {
            expect(singleSpa.getAppStatus('invalid-load-4')).toBe(singleSpa.NOT_BOOTSTRAPPED);
          }))
      })
github CanopyTax / single-spa / spec / parcels / app-mounts-parcel.spec.js View on Github external
.then(() => {
        expect(app.bootstrapCalls).toBe(1);
        expect(app.mountCalls).toBe(1);
        expect(app.unmountCalls).toBe(0);

        parcel = app.mountProps.mountParcel(parcelConfig, {domElement: document.createElement('div')});

        parcel.unmountPromise
          .then(() => unmountPromiseHasResolved = true)

        expect(parcel.getStatus()).toBe(singleSpa.NOT_BOOTSTRAPPED);
        expect(unmountPromiseHasResolved).toBe(false);

        return parcel
          .bootstrapPromise
          .then(() => {
            expect(parcel.getStatus()).toBe(singleSpa.NOT_MOUNTED);
            expect(unmountPromiseHasResolved).toBe(false);

            return parcel
              .mountPromise
              .then(() => {
                expect(parcel.getStatus()).toBe(singleSpa.MOUNTED);
                expect(unmountPromiseHasResolved).toBe(false);
                expect(parcelConfig.bootstrapCalls).toBe(1);
                expect(parcelConfig.mountCalls).toBe(1);
                expect(parcelConfig.unmountCalls).toBe(0);