html-preflight
Advanced tools
Comparing version 0.3.7 to 0.3.8
@@ -15,3 +15,8 @@ 'use strict'; | ||
try { | ||
return callback(null, htmlAutoprefixer.process(html, this.cheerioOptions, this.postcssOptions)); | ||
var prefixed = htmlAutoprefixer.process(html, this.cheerioOptions, this.postcssOptions); | ||
if (prefixed === '') { | ||
return callback(new Error('Invalid HTML')); | ||
} | ||
return callback(null, prefixed); | ||
} catch (e) { | ||
@@ -18,0 +23,0 @@ return callback(e); |
{ | ||
"name": "html-preflight", | ||
"version": "0.3.7", | ||
"version": "0.3.8", | ||
"description": "The HTML email preflight process, maximing compression without distortion", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# html-preflight | ||
[![Build Status](https://travis-ci.org/Rebelmail/html-preflight.svg?branch=master)](https://travis-ci.org/Rebelmail/html-preflight) | ||
[![NPM version](https://badge.fury.io/js/html-preflight.png)](http://badge.fury.io/js/html-preflight) | ||
@@ -4,0 +5,0 @@ |
@@ -7,2 +7,11 @@ 'use strict'; | ||
var plugins = require('../lib/plugins'); | ||
var Prefixer = plugins.PrefixerPlugin; | ||
var Uglifier = plugins.UglifierPlugin; | ||
var Minifier = plugins.MinifierPlugin; | ||
var prefixer = new Prefixer(); | ||
var uglifier = new Uglifier(); | ||
var minifier = new Minifier(); | ||
describe('HTMLPreflight', function() { | ||
@@ -53,2 +62,23 @@ describe('#constructor', function() { | ||
}); | ||
describe('integration tests', function () { | ||
var preflight; | ||
before(function() { | ||
preflight = new HTMLPreflight() | ||
}); | ||
it('raises an error with invalid html', function(done) { | ||
preflight.plugins = [ | ||
prefixer.run.bind(prefixer), | ||
uglifier.run.bind(uglifier), | ||
minifier.run.bind(minifier) | ||
] | ||
preflight.run('<htm', function(err, html) { | ||
expect(err).to.exist; | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11556
17
264
38