'use strict'; var htmlminOptionsParser = require('../lib/htmlminOptionsParser'); var expect = require('chai').expect; var htmlmin = '--htmlmin-'; describe('htmlminOptionsParser.spec.js', function() { it('should parse htmlmin options', function () { //given var rawArgs = [ '--output', '--no-new-module', '--no-strict', htmlmin + 'minifyCSS', htmlmin + 'minifyJS', htmlmin + 'anyOtherOption' ]; //when var result = htmlminOptionsParser(rawArgs); //then expect(result).to.eql({ minifyCSS: true, minifyJS: true, anyOtherOption: true }); }); it('should flip values for flags prefixed with no-', function() { //given var rawArgs = [ '--output', '--no-new-module', '--no-strict', htmlmin + 'no-html5', htmlmin + 'no-includeAutoGeneratedTags', htmlmin + 'minifyJS', htmlmin + 'minifyCSS' ]; //when var result = htmlminOptionsParser(rawArgs); //then expect(result).to.eql({ html5: false, includeAutoGeneratedTags: false, minifyJS: true, minifyCSS: true }); }); });