import { isNumber } from './is-number';

describe('Is Number', () => {
  it('should return true', () => {
    expect(isNumber(1)).toBeTruthy();
  });

  it('should return false when value is NaN and includeNaN is set to false', () => {
    expect(isNumber(+'test', { includeNaN: false })).toBeFalsy();
  });

  it('should return true when value is NaN and includeNaN is set to true', () => {
    expect(isNumber(+'test', { includeNaN: true })).toBeTruthy();
  });

  it('should return false when value is a string', () => {
    expect(isNumber('1')).toBeFalsy();
  });

  it('should return false when value is a Date', () => {
    expect(isNumber(new Date())).toBeFalsy();
  });

  it('should return false when value is an Array', () => {
    expect(isNumber(['1'])).toBeFalsy();
  });
});
