Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function testCleanup() {
temp.cleanup(result => {
if (typeof result === "boolean") {
const x = result;
} else {
const { files, dirs } = result;
files.toPrecision(4);
files.toPrecision(4);
}
});
}
app.post(`${exports.pathPrefix}/testing/cleanup`, ensureAuthenticated, (req, res) => {
//winston.info('Cleaned up: ' + JSON.stringify(cleaned));
res.json({ result: temp.cleanup() });
});
app.post(`${exports.pathPrefix}/testing/shutdown`, ensureAuthenticated, (req, res) => {
afterEach(done => {
temp.cleanup(done);
});
function execute(path, idx) {
if (idx == cmds.length) {
if (!self.keep) {
self.logger.info('Remove working directory: ' + self.path);
Tmp.cleanup();
} else {
self.logger.info('Keep working directory: ' + self.path);
}
return;
}
var fname = Path.join(path, 'task-' + pad(idx, 3));
Fs.writeFile(fname, cmds[idx], function (err) {
if (err) {
self.logger.error('File creation error: ' + err);
return;
}
self.logger.info('File created: ' + fname);
execFile(self.cmdshell, [ fname ], { cwd:path, env:process.env },
function (err, stdout, stderr) {
if (err) {
self.logger.error('Exec error: ' + err);
afterEach(done => {
temp.cleanup(done);
});
afterEach(done => {
temp.cleanup(done);
});
afterEach((done) => {
temp.cleanup(done);
});
afterEach((done) => {
temp.cleanup(done);
});
afterEach(done => {
temp.cleanup(done);
});
afterEach(done => {
temp.cleanup(done);
});