2020-02-03 10:24:25 +01:00
|
|
|
const fs = require("fs")
|
2019-07-03 00:15:15 +02:00
|
|
|
|
2020-02-03 10:24:25 +01:00
|
|
|
module.exports = config => ({
|
|
|
|
main: {
|
|
|
|
outputToFile: async ({ filename, content }) => {
|
|
|
|
await new Promise((resolve, reject) => {
|
|
|
|
fs.writeFile(
|
|
|
|
`./tests/.data/${filename}`,
|
|
|
|
content,
|
|
|
|
{ encoding: "utf8" },
|
|
|
|
err => {
|
|
|
|
if (err) reject()
|
|
|
|
else resolve(err)
|
|
|
|
}
|
|
|
|
)
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|