Skip to content

Instantly share code, notes, and snippets.

@bobsilverberg
Created November 25, 2019 21:23
Show Gist options
  • Save bobsilverberg/8c9c348848c7c830920f87f406a797bf to your computer and use it in GitHub Desktop.
Save bobsilverberg/8c9c348848c7c830920f87f406a797bf to your computer and use it in GitHub Desktop.
// Props of the <DiffView> component:
type DiffProps = {
children: (hunks: HunkInfo[]) => ReactNode;
className?: string;
diffType: string;
hunks: Hunks;
tokens?: Tokens;
viewType: ViewType;
gutterType?: 'default' | 'anchor' | 'none';
generateAnchorID?: (change: ChangeInfo) => string;
selectedChanges?: string[];
widgets?: WidgetMap;
renderGutter?: RenderGutter;
};
// Test code
const root = renderWithLinterProvider({ diff });
const { renderGutter } = root.find(Diff).props();
const gutter = shallow(renderGutter());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment