Example #1
0
 async.forEach(files, function (item, cb) {
   fs.unlink(path.join(test_root, item), cb);
 }, cb);
Example #2
0
 .on('end', function(count){
     console.log('Number of lines: '+count);
     fs.unlink(temp_path);
     res.json({message: '导入成功!'});
 })
 ,function(f,cb){
      fs.unlink(f,function(e){
          if(e) console.log('error unlinking '+f)
          return cb()
      })
  }
Example #4
0
 ,    endErr  = ((ii,p) => { return (err) => { _log('endErr',err,ii); fs.unlink(p); inProg[ii]=false; }})(i,fPath)
Example #5
0
 beforeEach(function(done) {
   fs.unlink(permissionFile, () => {
     done();
   });
 });
 function(callback)
 {
   fs.unlink(srcFile, callback);
 },
 after(function(done) {
   fs.unlink('test_file.json');
   done();
 });
Example #8
0
 res.sendFile(filename, {}, function () {
   // Cleanup.
   fs.unlink(filename)
   fs.unlink(tempFilename)
 });
Example #9
0
    break;
    default:
        testFile = 'test_gl2d';
}

console.log('Using ' + testFile);
console.log('Listening on :' + PORT + '\n');

// watch plotly.js
var watchifiedBundle = makeWatchifiedBundle(function onFirstBundleCallback() {
    _open('http://localhost:' + PORT + '/devtools/test_dashboard');
});
watchifiedBundle();

// build the test examples
fs.unlink(constants.pathToTestDashboardBundle, function() {
    browserify(path.join(__dirname, testFile), {
        debug: true,
        transform: [shortcutPaths]
    })
    .bundle(function(err) {
        if(err) throw err;
    })
    .pipe(fs.createWriteStream(constants.pathToTestDashboardBundle));
});

// boot up server
http.createServer(
    ecstatic({ root: constants.pathToRoot })
).listen(PORT);
Example #10
0
 _.forEach(files, function(fileInfo) {
   fs.unlink(fileInfo.path, function () {});
 });
Example #11
0
    exports.desired = {
        name:"Test Framework - Selenium wd",
        browserName:"Chrome",
        platform:"OS X 10.8",
        version: '35'
    };
}

var fs = require('fs');

exports.writeToFile = function(content) {
    fs.appendFile(nameOfTestLinkFile, content + "\n\n", function(err) {
        if(err) {
            exports.log.warn(err);
        } else {
            exports.log.info("The test link file was saved!");
        }
    }); 
}

fs.unlink(nameOfTestLinkFile, function(err) {
    if(err) {
        exports.log.warn(err);
    } else {
        exports.log.info("The test link file was removed!");
    }
});
    
exports.writeToFile("Sauce Test Reults");

Example #12
0
 fs.exists(f, function(exists) {
   assert(exists)
   fs.unlink(f,done)
 })
Example #13
0
 uploader.on('end', function(){
   fs.unlink(origFile);
   emitMessage(message, socket);
 })
Example #14
0
File: test.js Project: nbqx/estkpm
 after(function(done){
   fs.unlink(out,function(){
     done();
   });                      
 });
 fs.stat(target, function (err, targetStats) {
     test.equal(sourceStats.size, targetStats.size);
     fs.unlink(target, test.done);
     done();
 });
	var postReq = request.post({url: UPLOAD_URL, formData: formData}, function() {
		fs.unlink('./' + fileName);
		requestCallback.apply(this, arguments);
	});
Example #17
0
 setTimeout(function() 
 {
   fs.unlink(destFile, callback);
 }, 100);
 c.find({}, function(err, docs) {
   console.log(docs);
   fs.unlink('file');
 })
Example #19
0
 fs.rename(tmp, newName, function() {
    fs.unlink(tmp, function() {
       addStory(target);
    });
 });
Example #20
0
 files.forEach(file => {
   if (file === '.gitkeep') return;
   fs.unlink(o.dir + '/' + file);
 });
 fs.rename(files.upload.path, "/tmp/test.png", function(error) {
   if(error) {
     fs.unlink("/tmp/test.png");
     fs.rename(files.upload.path, "/tmp/test.png");
   }
 });
Example #22
0
var server;
fs.unlink(sock.unixPath('irc'), function (err) {
  server = net.createServer(function (c)  {
    console.log('master connected');
    sock.json(c);
    server.c = c;
    
    c.on('end', function () {
      server.c = null;
      console.log('master disconnected');
    });
    
    c.on('json', function (msg) {
      if (msg.welcome == 'hey') {
        c.write(JSON.stringify({welcome: 'hey', protocols: ['irc']}) + '\n');
      } else if (msg.prep) {
        var conn = fetchConn(msg.prep);
        c.write(JSON.stringify({guid: conn.guid, status: conn.status}) + '\n');
      } else if (msg.refresh) {
        var conn = conns[msg.refresh];
        c.write(JSON.stringify({guid: conn.guid, status: conn.status}) + '\n');
      } else if (msg.guid) {
        var conn = conns[msg.guid];
        conn.sock.write(msg.line + '\r\n');
      };
    });
    
  }).listen(sock.unixPath('irc'), function () {
    console.log('ready for master');
  });
});
Example #23
0
		teardown(function (done) {
			fs.unlink(settings.hostsFile.tempPath, function() {
				done();
			});
		});
Example #24
0
Store.prototype.delete = function del(key, callback) {
  if (this.exists(key)) {
    fs.unlink(this._fullpath(key), callback)
  } else throw new Error("Key does not exist: " + key);
}
Example #25
0
 .on('error', function(error){
     fs.unlink(temp_path);
     return next(error);
 });
 request.on('error', function(e) {
   console.log('problem with request: ' + e.message);
   fs.unlink(req.file.path);
   res.send("Some error occured");
 });
Example #27
0
 setTimeout( function(){
   fs.unlink(path, function(err) {
     if (err) console.log(err);
     console.log('file successfully deleted');
   });
 }, 60 * 1000);
Example #28
0
 after(function(done) {
   fs.unlink(testFile, done)
 })
Example #29
0
 .callback(function(path,callback){
   fs.unlink(path,callback)
 })
 afterEach(function(done) {
     fs.unlink(filePath, function(err){
         done();
     });
 });