Skip to content

Commit

Permalink
Linting more files & fixing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Jul 10, 2018
1 parent 4002194 commit e20df70
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
15 changes: 11 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
module.exports = function (grunt) {
grunt.initConfig({
eslint: {
target: ["lib/*.js"]
target: [
"Gruntfile.js",
"index.js",
"lib/*.js",
"test/*.js"
]
},
mochaTest : {
mochaTest: {
options: {
reporter: "spec"
},
test : {
src : ["test/*.js"]
test: {
src: [
"test/*.js"
]
}
},
nsp: {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tiny-etag",
"version": "1.4.7",
"version": "1.5.0",
"description": "ETag middleware",
"main": "index.js",
"scripts": {
Expand Down
10 changes: 5 additions & 5 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const http = require("http"),
path = require("path"),
random = Math.floor(Math.random()*9)+1,
random = Math.floor(Math.random() * 9) + 1,
mmh3 = require("murmurhash3js").x86.hash32,
etagValue = "\"" + mmh3("Hello World!", random) + "\"",
cacheSize = 1000,
Expand All @@ -18,8 +18,8 @@ router.use("/", function hello (req, res) {
});

router.use("/no-cache", function hello (req, res) {
res.writeHead(200, {"Content-Type": "text/plain", "Cache-Control":"no-cache"});
res.end("Hello World!");
res.writeHead(200, {"Content-Type": "text/plain", "Cache-Control": "no-cache"});
res.end("Hello World!");
});

http.createServer(router.route).listen(8001);
Expand Down Expand Up @@ -48,7 +48,7 @@ describe("Valid ETag", function () {
});

it("GET / (304 / empty)", function () {
return tinyhttptest({url: "http://localhost:8001/", headers:{"If-None-Match": etagValue}})
return tinyhttptest({url: "http://localhost:8001/", headers: {"If-None-Match": etagValue}})
.expectStatus(304)
.expectHeader("Age", /\d+/)
.expectHeader("Content-Length", undefined)
Expand All @@ -58,7 +58,7 @@ describe("Valid ETag", function () {
});

it("GET / (304 / empty & validation)", function () {
return tinyhttptest({url: "http://localhost:8001/", headers:{"If-None-Match": etagValue}})
return tinyhttptest({url: "http://localhost:8001/", headers: {"If-None-Match": etagValue}})
.expectStatus(304)
.expectHeader("Age", /\d+/)
.expectHeader("Content-Length", undefined)
Expand Down

0 comments on commit e20df70

Please sign in to comment.