import chai from 'chai';
const expect = chai.expect;
import checkMinifiedCss from '../../../../src/html/css/minify/minify.js';

describe('html', function() {
  describe('test minify function', function() {
    it('should return array with error if CSS is not minified', () => {
      const result = {
        body: '.whatever { color: white; font-size: 15px; }',
      };

      const error = checkMinifiedCss(result);
      expect(error.length).to.equal(1);
    });

    it('should return empty array', () => {
      const result = {
        body: '.whatever{color:#fff;font-size:15px}',
      };

      const error = checkMinifiedCss(result);
      expect(error.length).to.equal(0);
    });
  });
});

import chai from 'chai';
const expect = chai.expect;
import checkMinifiedCss from '../../../../src/html/css/minify/minify.js';

describe('html', function() {
  describe('test minify function', function() {
    it('should throw error if CSS is not minified', () => {
      const result = {
        body: '.whatever { color: white; font-size: 15px; }',
      };

      expect(checkMinifiedCss.bind(null, result)).to.throw();
    });

    it('should return without error', () => {
      const result = {
        body: '.whatever{color:#fff;font-size:15px}',
      };

      expect(checkMinifiedCss.bind(null, result)).to.not.throw();
    });
  });
});

Fix css minify function test