1 year ago

#70127

test-img

Vitalii505

How to mock and testing an FTP Connection with Mocha

I am using the FTP library to establish an FTP connection to receive files from a specific location. I need to cover with tests mocha

    const client = new Client();
    const connect = {
     host: 'host',
     port: 21,
     user: 'user',
     password: 'password'
   }
   
   client.on('ready', function() {
    client.list(function(err, list) {
     if (err) throw err;
     console.log(list);
     client.end();
    });
  });
  client.connect(connect);

testing

mocking

ftp

mocha.js

0 Answers

Your Answer

Accepted video resources