Backstage
    Preparing search index...

    Function createVersionedContextForTesting

    • Creates a helper for writing tests towards multiple different combinations of versions provided from a context.

      Parameters

      • key: string

        A key that uniquely identifies the context.

      Returns { reset(): void; set(versions: { [key: number]: unknown }): void }

      const context = createVersionedContextForTesting('my-context');

      afterEach(() => {
      context.reset();
      });

      it('should work when provided with version 1', () => {
      context.set({1: 'value-for-version-1'})

      // ...
      })