Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
fs = {
writeFile : function(file, content, encoding, cb) {
written[file] = JSON.parse(content);
cb();
}
};
// Supress all logging during tests
log = {
info : function () {}
, verbose : function () {}
, silly : function () {}
, error : function () {}
};
publish = proxyquire.resolve('../lib/publish', __dirname, {
fs : fs
, './utl' : utl
, npmlog : log
});
})
/*jshint asi:true, esnext:true */
var proxyquire = require('proxyquire')
, should = require('should')
, sut = proxyquire.resolve('../lib/publisher', __dirname, { npmlog: require('./fakes/npmlog') })
, path = require('path')
, fs = require('fs')
, utl = require('../lib/utl')
, blogdir = path.join(__dirname, 'fixtures', 'testblog')
, blogjsonFile = path.join(blogdir, 'blog.json')
, postunodir = path.join(blogdir, 'postuno')
, postunojsonFile = path.join(postunodir, 'post.json')
, postdosdir = path.join(blogdir, 'postdos')
, postdosjsonFile = path.join(postdosdir, 'post.json')
, cleanups = [ blogjsonFile, postunojsonFile, postdosjsonFile ]
, opts