Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Commit

Permalink
add test for json
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterDaveHello committed May 17, 2015
1 parent 487c9eb commit b3eb2b5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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': [
Expand All @@ -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."}'}
]
};

Expand All @@ -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() {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit b3eb2b5

Please sign in to comment.