const tempout = function() { var file = tmp.fileSync({ mode: 0644, postfix: '.out' }); return file; }
describe("toFile", function() { beforeEach(function() { nock("https://api.tinify.com") .post("/shrink") .reply(201, {}, {location: "https://api.tinify.com/some/location"}) nock("https://api.tinify.com") .get("/some/location") .reply(200, "compressed file") }) it("should store image data", function() { const file = tmp.fileSync() const promise = tinify.Source.fromBuffer("png file").toFile(file.name) return promise.then(function() { assert.equal("compressed file", fs.readFileSync(file.name)) }) }) })
test.expectAgent(action, code); const tmpFile = tmp.fileSync().name; tmp.setGracefulCleanup();
var bootstrapFile = tmp.fileSync({});
const tempFile = tmp.fileSync({ prefix: "wordup-archive-", postfix: ".tar.gz"
test.expectAgent(action, code); const tmpFile = tmp.fileSync().name; tmp.setGracefulCleanup();
const file = tmp.fileSync() return optimized.toFile(file.name).then(function() { const size = fs.statSync(file.name).size const file = tmp.fileSync() return source.toFile(file.name).then(function() { const size = fs.statSync(file.name).size const file = tmp.fileSync() return optimized.resize({method: "fit", width: 50, height: 20}).toFile(file.name).then(function() { const size = fs.statSync(file.name).size const file = tmp.fileSync() return optimized.preserve("copyright", "creation").toFile(file.name).then(function() { const size = fs.statSync(file.name).size
test.expectAgent(action, code); const tmpFile = tmp.fileSync().name; console.log(tmpFile); tmp.setGracefulCleanup();
test.expectAgent(action, code); const tmpFile = tmp.fileSync().name; tmp.setGracefulCleanup();
test.expectAgent(action, code); const tmpFile = tmp.fileSync().name; tmp.setGracefulCleanup();
const tempr = function() { var file = tmp.fileSync({ mode: 0644, postfix: '.R'}); return file; }
var bootstrapFile = tmp.fileSync({});
test.expectAgent(action, code); const tmpFile = tmp.fileSync().name; tmp.setGracefulCleanup();