开发者

Zombie.js testing framework, write to a file

开发者 https://www.devze.com 2023-03-16 16:02 出处:网络
I have not found anything yet about being able to write to a file with Zombie.js. I realize that js doesn\'t normally allow writing to files, but is it possible to combine Node.js with Zombie.js?

I have not found anything yet about being able to write to a file with Zombie.js.

I realize that js doesn't normally allow writing to files, but is it possible to combine Node.js with Zombie.js?

Does anyone know if it's at all possible to write to开发者_高级运维 a file with the Zombie.js framework?

I'm really just attempting to dump the contents of an html page when the test fails, as I won't be around to see it fail.


Since Zombie.js is built on Node.js, you can use the node fs module as @Jim Schubert suggested.

fs.writeFile('message.txt', 'Hello Node', function (err) {
  if (err) throw err;
  console.log('It\'s saved!');
});

Manual

0

精彩评论

暂无评论...
验证码 换一张
取 消