<commit_before>"use strict"
const describe   = require('mocha').describe
const it         = require('mocha').it
const expect     = require('chai').expect
const HSL       = require('../../build/glow').HSL
const RGB       = require('../../build/glow').RGB
const Hex       = require('../../build/glow').Hex

describe('HSL', () => {

  it('should convert to rbg', () => {
    let hsl = new HSL([0, 0, 92])
    let rgb = hsl.toRgb()
    expect(rgb).to.be.instanceof(RGB)
    expect(rgb.toString()).to.equal('rgb(235,235,235)')
    expect(rgb.toArray()).to.deep.equal([235, 235, 235])
  })
  
  it('should convert to hex', () => {
    let hsl = new HSL([0, 0, 92])
    let hex = hsl.toHex()
    expect(hex).to.be.instanceof(Hex)
    expect(hex.toString()).to.equal('#EBEBEB')
  })
  
  it('should validate strings as hsl', () => {
    expect(HSL.isValid('hsl(0,0,92)')).to.equal(true)
  })
  
})<commit_msg>add validition test for HSL<commit_after>"use strict"
const describe   = require('mocha').describe
const it         = require('mocha').it
const expect     = require('chai').expect
const HSL       = require('../../build/glow').HSL
const RGB       = require('../../build/glow').RGB
const Hex       = require('../../build/glow').Hex

describe('HSL', () => {

  it('should convert to rbg', () => {
    let hsl = new HSL([0, 0, 92])
    let rgb = hsl.toRgb()
    expect(rgb).to.be.instanceof(RGB)
    expect(rgb.toString()).to.equal('rgb(235,235,235)')
    expect(rgb.toArray()).to.deep.equal([235, 235, 235])
  })
  
  it('should convert to hex', () => {
    let hsl = new HSL([0, 0, 92])
    let hex = hsl.toHex()
    expect(hex).to.be.instanceof(Hex)
    expect(hex.toString()).to.equal('#EBEBEB')
  })
  
  it('should throw an error with in valid input', () => {
    let fn = function () {
      new HSL('ZZZ')
    }
    expect(fn).to.throw()
    fn = function () {
      new HSL('#EBEBEB')
    }
    expect(fn).to.throw()
  })  
  
  it('should validate strings as hsl', () => {
    expect(HSL.isValid('hsl(0,0,92)')).to.equal(true)
  })
  
})
{'fraction_non_alphanumeric': 0.21428571428571427, 'fraction_numerical': 0.029354207436399216, 'mean_word_length': 2.78003696857671, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '2933763', 'n_tokens_mistral': 794, 'n_tokens_neox': 739, 'n_words': 143}