Permalink
Browse files

Linting

1 parent 02407d5 commit 1fcaf54cf79aca1a7d6af8d520ef581c608a1a4e @TimothyGu TimothyGu committed Jan 22, 2015
Showing with 9 additions and 10 deletions.
  1. +1 −0 .jshintrc
  2. +1 −1 lib/ejs.js
  3. +7 −9 test/ejs.js
View
@@ -7,6 +7,7 @@
"immed": true,
"undef": true,
"node": true,
+ "unused": true,
"globals": {
"window": false
}
View
@@ -505,7 +505,7 @@ exports.__express = function () {
arguments[1].__expressRender__ = true;
}
exports.renderFile.apply(null, arguments);
-}
+};
// Add require support
/* istanbul ignore else */
View
@@ -217,14 +217,13 @@ suite('ejs.renderFile(path, [data], [options], fn)', function () {
test('deprecation warning for data-in-opts', function(done) {
var data = {name: 'fonebone', delimiter: '$'}
- , options = {delimiter: '$'}
, warn = console.warn
, incr = 0;
console.warn = function (msg) {
assert.ok(msg.indexOf('options found in locals object') > -1);
incr++;
- }
+ };
ejs.renderFile('test/fixtures/user.ejs', data, function(err, html) {
if (err) {
@@ -240,13 +239,12 @@ suite('ejs.renderFile(path, [data], [options], fn)', function () {
test('no deprecation warning for data-in-opts via Express', function(done) {
var data = {name: 'fonebone', delimiter: '$'}
- , options = {delimiter: '$'}
, warn = console.warn
, incr = 0;
- console.warn = function (msg) {
+ console.warn = function () {
incr++;
- }
+ };
ejs.__express('test/fixtures/user.ejs', data, function(err, html) {
if (err) {
@@ -328,10 +326,10 @@ suite('ejs.renderFile(path, [data], [options], fn)', function () {
test('support caching (pass 1)', function (done) {
var expected = '<p>Old</p>'
, file = __dirname + '/tmp/renderFile.ejs'
- , options = {cache: true}
+ , options = {cache: true};
fs.writeFileSync(file, '<p>Old</p>');
- var out = ejs.renderFile(file, {}, options, function (err, out) {
+ ejs.renderFile(file, {}, options, function (err, out) {
if (err) {
done(err);
}
@@ -343,10 +341,10 @@ suite('ejs.renderFile(path, [data], [options], fn)', function () {
test('support caching (pass 2)', function (done) {
var expected = '<p>Old</p>'
, file = __dirname + '/tmp/renderFile.ejs'
- , options = {cache: true}
+ , options = {cache: true};
fs.writeFileSync(file, '<p>New</p>');
- var out = ejs.renderFile(file, {}, options, function (err, out) {
+ ejs.renderFile(file, {}, options, function (err, out) {
if (err) {
done(err);
}

0 comments on commit 1fcaf54

Please sign in to comment.