Skip to content

Instantly share code, notes, and snippets.

@chris-feist
Last active September 11, 2018 21:47
Show Gist options
  • Save chris-feist/6805c226aae40a8699523c3eadaddaec to your computer and use it in GitHub Desktop.
Save chris-feist/6805c226aae40a8699523c3eadaddaec to your computer and use it in GitHub Desktop.
Sample test code for babel-plugin-testable
import { putUser, getKey, cache } from './babel-plugin-testable-source.js';
beforeEach(() => {
// Reset cache
for (const key of Object.keys(cache)) {
delete cache[key];
}
});
describe('getKey', () => {
it('valid names', () => {
const firstName = 'First';
const lastName = 'Last';
const result = getKey(firstName, lastName);
expect(result).toEqual('First_Last');
});
});
// Additional tests for exported code...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment