UNPKG

@passmarked/css

Version:

Rules related to checking the compatability of the CSS on the page ensuring the stylesheet works on older browsers too

72 lines (47 loc) 1.75 kB
// modules var assert = require('assert') var _ = require('underscore') var fs = require('fs'); var S = require('string'); var passmarked = require('passmarked'); var pluginFunc = require('../lib/rules/lint/prettify'); describe('lint', function(){ describe('#prettify', function(){ // handle the settings it('Should return a error if the message passed was undefined', function(done){ // handle the stream pluginFunc(undefined, function(err, content){ // check for a error if(!err) assert.fail('Was expecting a error for the undefined content'); // done done(); }); }); // handle the settings it('Should return a error if the message passed was null', function(done){ // handle the stream pluginFunc(null, function(err, content){ // check for a error if(!err) assert.fail('Was expecting a error for the null content'); // done done(); }); }); // handle the settings it('Should return a pretified version from our passed in CSS', function(done){ // handle the stream pluginFunc('.text{color:black;}', function(err, content){ // check for a error if(err) assert.fail(err); // check if not empty if(S(content).isEmpty() == true) assert.fail('Prettified content was blank') // should match a cleaned version if(content.replace(/\s+/gi, '') != '.text{color: black;}'.replace(/\s+/gi, '')) assert.fail('Did not clean the content correctly.'); // done done(); }); }); }); });