curved-magician-42592
04/18/2023, 7:24 PMcy.task('show_files', __dirname).then((file) => forEach((file) => cy.log(file)))
output:
task: show_files, cypress/integration/tests
my task code:
on('task', {
show_files(directory) {
return fs.readdirSync(directory);
}
}
My custom cy.task show_files() works but I can't get my Cypress logs to list the contents of my directory. fs.readdirSync() returns an Array. How can I loop through the returned Array to show each element in Cypress? I spent 8 hours on this ticket and I can't figure it out.. :[