Skip to content

Instantly share code, notes, and snippets.

@monkeycycle
Forked from mattmontgomery/Helpers-test.js
Created March 11, 2016 23:07
Show Gist options
  • Save monkeycycle/daecdbefb4d93c5a69b3 to your computer and use it in GitHub Desktop.
Save monkeycycle/daecdbefb4d93c5a69b3 to your computer and use it in GitHub Desktop.
/**
* Installed `jest`, `jest-cli`; ran test with `--no-watchman`
*/
describe('Helpers', function() {
jest.autoMockOff();
var Helpers = require('../helpers');
describe('isFloat', function() {
it('has isFloat as an export', function() {
expect(Helpers.isFloat).not.toBeNull();
});
var isFloat = Helpers.isFloat;
it('returns false on strings', function() {
expect(isFloat('test')).toBe(false);
});
it('returns true on float', function() {
expect(isFloat(0.1)).toBe(true);
})
it('returns false on not-float', function() {
expect(isFloat(1)).toBe(false);
})
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment