How to write unit test with jest for function that run command with spawn module And it has no return?

Viewed 66

For example I have function like this:

const interfaceAddAddress = (tag, ip) => { 

  spawn('bash', ['-c', `ip addr add ${ip} dev ${tag}`]);

};

How to writ unit test with jest for it?

0 Answers
Related