<commit_before>import * as validations from '../_isValidColor'

describe('isValidColor', () => {
  // hex
  it('isHex should return true when color is #fff', () => {
    expect(validations.isHex('#fff')).toEqual(true)
  })

  it('isHex should return true when color is #000000', () => {
    expect(validations.isHex('#000000')).toEqual(true)
  })

  it('isHex should return false when color is #00', () => {
    expect(validations.isHex('#00')).toEqual(false)
  })

  // rgb
  it('isRgb should return true when color is rgb(0,0,0)', () => {
    expect(validations.isRgb('rgb(0,0,0)')).toEqual(true)
  })

  it('isRgb should return true when color is rgb(255, 0, 0)', () => {
    expect(validations.isRgb('rgb(255, 0, 0)')).toEqual(true)
  })

  it('isRgb should return false when color is rgba(255, 0, 0, 1)', () => {
    expect(validations.isRgb('rgba(255, 0, 0, 1)')).toEqual(false)
  })

  // rgba
  it('isRgba should return true when color is rgba(0,0,0,0)', () => {
    expect(validations.isRgba('rgba(0,0,0,0)')).toEqual(true)
  })

  it('isRgba should return true when color is rgb(255, 0, 0, .5)', () => {
    expect(validations.isRgba('rgba(255, 0, 0, .5)')).toEqual(true)
  })

  it('isRgba should return false when color is rgb(255, 0, 0)', () => {
    expect(validations.isRgba('rgb(255, 0, 0)')).toEqual(false)
  })

  // hsl
  it('isHsl should return true when color is hsl(0,0%,100%)', () => {
    expect(validations.isHsl('hsl(0,0%,100%)')).toEqual(true)
  })

  it('isHsl should return true when color is hsl(10,10%,100%)', () => {
    expect(validations.isHsl('hsl(10,10%,100%)')).toEqual(true)
  })

  it('isHsl should return false when color is hsla(10,10%,100%)', () => {
    expect(validations.isHsl('hsla(10,10%,100%)')).toEqual(false)
  })



})
<commit_msg>chore(transparentize): Added _isValidColor.test.js isHsla tests<commit_after>// @flow
import * as validations from '../_isValidColor'

describe('isValidColor', () => {
  // hex
  it('isHex should return true when color is #fff', () => {
    expect(validations.isHex('#fff')).toEqual(true)
  })

  it('isHex should return true when color is #000000', () => {
    expect(validations.isHex('#000000')).toEqual(true)
  })

  it('isHex should return false when color is #00', () => {
    expect(validations.isHex('#00')).toEqual(false)
  })

  // rgb
  it('isRgb should return true when color is rgb(0,0,0)', () => {
    expect(validations.isRgb('rgb(0,0,0)')).toEqual(true)
  })

  it('isRgb should return true when color is rgb(255, 0, 0)', () => {
    expect(validations.isRgb('rgb(255, 0, 0)')).toEqual(true)
  })

  it('isRgb should return false when color is rgba(255, 0, 0, 1)', () => {
    expect(validations.isRgb('rgba(255, 0, 0, 1)')).toEqual(false)
  })

  // rgba
  it('isRgba should return true when color is rgba(0,0,0,0)', () => {
    expect(validations.isRgba('rgba(0,0,0,0)')).toEqual(true)
  })

  it('isRgba should return true when color is rgb(255, 0, 0, .5)', () => {
    expect(validations.isRgba('rgba(255, 0, 0, .5)')).toEqual(true)
  })

  it('isRgba should return false when color is rgb(255, 0, 0)', () => {
    expect(validations.isRgba('rgb(255, 0, 0)')).toEqual(false)
  })

  // hsl
  it('isHsl should return true when color is hsl(0,0%,100%)', () => {
    expect(validations.isHsl('hsl(0,0%,100%)')).toEqual(true)
  })

  it('isHsl should return true when color is hsl(10,10%,100%)', () => {
    expect(validations.isHsl('hsl(10,10%,100%)')).toEqual(true)
  })

  it('isHsl should return false when color is hsla(10,10%,100%)', () => {
    expect(validations.isHsl('hsla(10,10%,100%)')).toEqual(false)
  })

  // hsla
  it('isHsla should return true when color is hsla(0,0%,100%,1)', () => {
    expect(validations.isHsla('hsla(0,0%,100%,1)')).toEqual(true)
  })

  it('isHsla should return true when color is hsla(10,10%,100%,.5)', () => {
    expect(validations.isHsla('hsla(10,10%,100%,.5)')).toEqual(true)
  })

  it('isHsla should return false when color is hsl(10,10%,2%)', () => {
    expect(validations.isHsla('hsl(10,10%,2%)')).toEqual(false)
  })

})

{'fraction_non_alphanumeric': 0.2139523458609678, 'fraction_numerical': 0.06435765168263326, 'mean_word_length': 4.147914032869785, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '245584', 'n_tokens_mistral': 1718, 'n_tokens_neox': 1576, 'n_words': 310}