Zombie.js testing framework, write to a file
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
精彩评论