aboutsummaryrefslogtreecommitdiff
path: root/node_modules/express-minify-html/tests/index.js
diff options
context:
space:
mode:
authornanalelfe <nargiza.nosirova@mail.utoronto.ca>2016-07-27 08:59:55 +0000
committernanalelfe <nargiza.nosirova@mail.utoronto.ca>2016-07-27 08:59:55 +0000
commit197e17a7bcbb5459897b7f334a790706c064c31c (patch)
treeaf4c3ebb095261dceac8fd00229d01bf1282f3d1 /node_modules/express-minify-html/tests/index.js
parentb0cbe2db0ee3311fc028e7229749726d4cfe6973 (diff)
parent21a885311321299163b4cae69d672baaddfba37b (diff)
Merge branch 'master' of https://github.com/HumairAK/solutions_repo
Diffstat (limited to 'node_modules/express-minify-html/tests/index.js')
-rw-r--r--node_modules/express-minify-html/tests/index.js79
1 files changed, 0 insertions, 79 deletions
diff --git a/node_modules/express-minify-html/tests/index.js b/node_modules/express-minify-html/tests/index.js
deleted file mode 100644
index 26a20d7..0000000
--- a/node_modules/express-minify-html/tests/index.js
+++ /dev/null
@@ -1,79 +0,0 @@
-'use strict';
-
-var express = require('express');
-var request = require('supertest');
-var test = require('tape');
-var fs = require('fs');
-
-var minifyHTML = require('../minifier.js');
-var expectedHTML = fs.readFileSync(__dirname + '/test.output.html', 'utf8');
-
-var exhbs = require('express-handlebars');
-var hbs = exhbs.create({
- defaultLayout: 'test',
- layoutsDir: __dirname
-});
-
-var nunjucks = require('nunjucks');
-nunjucks.configure(__dirname, {
- autoescape: true,
- express: app
-});
-
-var app = express();
-
-app.engine('handlebars', hbs.engine);
-app.engine('nunjucks', nunjucks.render);
-
-app.set('views', __dirname);
-
-app.use(minifyHTML({
- override: true,
- htmlMinifier: {
- removeComments: true,
- collapseWhitespace: true,
- collapseBooleanAttributes: true,
- removeAttributeQuotes: true,
- removeEmptyAttributes: true,
- minifyJS: true
- }
-}));
-
-app.get('/test', function (req, res, next) {
- res.render('test', { hello : 'world' });
-});
-
-function checkMinified(t) {
- request(app)
- .get('/test')
- .expect(200)
- .end(function (err, res) {
- t.equal(res.text, expectedHTML);
- t.end();
- });
-};
-
-test('Should minify EJS templates', function (t) {
- app.set('view engine', 'ejs');
-
- checkMinified(t);
-});
-
-test('Should minify Pug templates', function (t) {
- app.set('view engine', 'pug');
-
- checkMinified(t);
-});
-
-test('Should minify Handlebars templates', function (t) {
- app.set('view engine', 'handlebars');
-
- checkMinified(t);
-});
-
-test('Should minify Nunjucks templates', function (t) {
- app.set('view engine', 'nunjucks');
-
- checkMinified(t);
-});
-