From b3eb2b592276790bc097ec624bf2ae22e19ed1d1 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Sun, 17 May 2015 21:34:18 +0800 Subject: [PATCH] add test for json --- test/test.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/test.js b/test/test.js index 728c565..bbd88f1 100644 --- a/test/test.js +++ b/test/test.js @@ -14,6 +14,7 @@ var sass = require('node-sass'); var less = require('less'); var stylus = require('stylus'); var coffee = require('coffee-script'); +JSON.minify = require("node-json-minify"); var expectation = { 'js': [ @@ -35,6 +36,9 @@ var expectation = { ], 'coffee': [ {src: 'square = (x) -> x * x'} + ], + 'json': [ + {src: '{ "name" : "express-minify" , "author" : "Breezewish" , "description" : "An express middleware to automatically minify and cache your javascript and css files."}'} ] }; @@ -44,7 +48,8 @@ var header = { 'sass': 'text/x-scss', 'less': 'text/less', 'stylus': 'text/stylus', - 'coffee': 'text/coffeescript' + 'coffee': 'text/coffeescript', + 'json': 'application/json' }; describe('minify()', function() { @@ -264,6 +269,13 @@ function init(callback) { }); } + minifyFunc.json = function(content, callback) { + callback({ + processed: content, + minified: JSON.minify(content) + }); + } + minifyFunc.css = function(content, callback) { callback({ processed: content,