Skip to content

Instantly share code, notes, and snippets.

@garbles
Last active March 6, 2017 17:22
Show Gist options
  • Save garbles/a0d0cdd08b134d00b3bc9dc581f336b8 to your computer and use it in GitHub Desktop.
Save garbles/a0d0cdd08b134d00b3bc9dc581f336b8 to your computer and use it in GitHub Desktop.
import setName from './setName';
import {types} from 'babel-plugin-transform-flow-to-gen/api';
import type {Person} from './types';
require('jasmine-check').install();
describe('setName', () => {
it.check('sets a new name', [Person(), types.string()], (person, newName) => {
const next = setName(person, newName);
expect(next.name).toEqual(newName);
expect(person).not.toBe(next);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment