hunk.code_window: export interface TransitionDefinition<
     TContext extends MachineContext,
     TEvent extends EventObject
   > extends TransitionConfig<TContext, TEvent> {
     target: Array<StateNode<TContext, TEvent>> | undefined;
     source: StateNode<TContext, TEvent>;
     actions: BaseActionObject[];
  
hunk.labels: keep keep keep replace keep keep keep
hunk.after_edit: > extends Omit<TransitionConfig<TContext, TEvent>, 'target'> {
  
hunk.file_path: packages/core/src/types.ts
hunk.type: replace
file: import { mapState } from '../src/index';
  
  describe('mapState()', () => {
    it('should return the first mapping found of a state', () => {
      const mapping = mapState(
        {
          a: 'state a',
          b: 'state b'
        },
        'b'
      );
  
      expect(mapping).toBe('state b');
    });
  
    it('should return undefined for unmapped states', () => {
      const mapping = mapState(
        {
          a: 'state a',
          b: 'state b'
        },
        'c'
      );
  
      expect(mapping).not.toBeDefined();
    });
  
    it('should prioritize returning equivalent state mapping', () => {
      const mapping = mapState(
        {
          a: 'state a',
          b: 'state b',
          'b.b1': 'st b.b1'
        },
        'b.b1'
      );
  
      expect(mapping).toBe('st b.b1');
    });
  
    it('should return superstate mapping when substate is not found', () => {
      const mapping = mapState(
        {
          a: 'state a',
          b: 'state b',
          'b.b1': 'st b.b1'
        },
        'b.foo'
      );
  
      expect(mapping).toBe('state b');
    });
  
    it('should return superstate mapping when deep substate is not found', () => {
      const mapping = mapState(
        {
          a: 'state a',
          b: 'state b',
          'b.b1': 'state b.b1'
        },
        'b.b1.foo'
      );
  
      expect(mapping).toBe('state b.b1');
    });
  });
  