faux-knox-2
Advanced tools
Comparing version 0.1.8 to 0.1.9
@@ -139,3 +139,3 @@ var fs = require("fs"); | ||
walker.on("file", function (root, stat, next) { | ||
files.push({Key: root + stat.name}); | ||
files.push({Key: options.prefix + stat.name}); | ||
next(); | ||
@@ -142,0 +142,0 @@ }); |
{ | ||
"name": "faux-knox-2", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"description": "Mock requests to knox module using file system", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
22
test.js
@@ -46,24 +46,2 @@ var should = require("should"); | ||
}); | ||
it("should pipe a file", function(done) { | ||
client.getFile("path/to/test.json", null, function(err, cres) { | ||
cres.should.have.property("headers").be.a("object"); | ||
cres.should.have.property("statusCode", 200); | ||
function getFile(callback) { | ||
fs.mkdirSync("./test_files/from"); | ||
var stream = fs.createWriteStream("./test_files/from/test.json"); | ||
cres.on("end", callback); | ||
cres.on("error", callback); | ||
cres.pipe(stream); | ||
} | ||
function getFSFile(callback) { | ||
fs.readFile("./test_files/path/to/test.json", callback); | ||
} | ||
async.parallel([getFile, getFSFile], function(err, results) { | ||
results[0] = fs.readFileSync("./test_files/from/test.json"); | ||
should.strictEqual(results[0].toString(), results[1].toString()); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
it("should not get a file", function(done) { | ||
@@ -70,0 +48,0 @@ client.getFile("path/to/nofile.txt", null, function(err, cres) { |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
11882
285
1