Comparing version 3.2.5 to 3.3.0
{ | ||
"name": "send-data", | ||
"version": "3.2.5", | ||
"version": "3.3.0", | ||
"description": "send data through response", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
@@ -6,2 +6,3 @@ var test = require("tape") | ||
var sendHtml = require("../html") | ||
var sendPlain = require("../plain") | ||
@@ -40,2 +41,10 @@ testServer(handleRequest, startTest) | ||
sendHtml(req, res, "<div>foo</div>") | ||
} else if (req.url === "/plain") { | ||
sendPlain(req, res, { | ||
body: "OK", | ||
statusCode: 200, | ||
headers: {} | ||
}) | ||
} else if (req.url === "/plain/optional") { | ||
sendPlain(req, res, "OK") | ||
} | ||
@@ -108,3 +117,23 @@ } | ||
test("plain", function (t) { | ||
request("/plain", function (err, res, body) { | ||
t.equal(body, "OK") | ||
t.equal(res.statusCode, 200) | ||
t.equal(res.headers["content-type"], "text/plain; charset=utf-8") | ||
t.end() | ||
}) | ||
}) | ||
test("plain-optional", function (t) { | ||
request("/plain/optional", function (err, res, body) { | ||
t.equal(body, "OK") | ||
t.equal(res.statusCode, 200) | ||
t.equal(res.headers["content-type"], "text/plain; charset=utf-8") | ||
t.end() | ||
}) | ||
}) | ||
.on("end", done) | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13437
16
265