Skip to content

Instantly share code, notes, and snippets.

@garbles
Last active March 10, 2017 20:03
Show Gist options
  • Save garbles/101d59455d112ada7e5c3de54b2da4a3 to your computer and use it in GitHub Desktop.
Save garbles/101d59455d112ada7e5c3de54b2da4a3 to your computer and use it in GitHub Desktop.
import {sampleOne} from 'babel-plugin-transform-flow-to-gen/api';
type Person = {
name: string,
age: number,
setName: (name: string) => Person
};
const person = sampleOne(Person());
person.setName('hello');
expect(person.setName).toHaveBeenCalledWith('hello');
// true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment