diff --git a/README.md b/README.md index 6467ad2..98338d5 100644 --- a/README.md +++ b/README.md @@ -31,12 +31,12 @@ require('cy-verify-downloads').addCustomCommand(); Then you need to add the following lines of code to your project's `cypress.config.js`: ```javascript -const { isFileExist, findFiles } = require('cy-verify-downloads'); +const { verifyDownloadTasks } = require('cy-verify-downloads'); module.exports = defineConfig({ e2e: { setupNodeEvents(on, config) { - on('task', { isFileExist, findFiles }); + on('task', verifyDownloadTasks); }, }, }); @@ -53,10 +53,10 @@ require('cy-verify-downloads').addCustomCommand(); And add the following lines to your project's `cypress/plugins/index.js`: ```javascript -const { isFileExist, findFiles } = require('cy-verify-downloads'); +const { verifyDownloadTasks } = require('cy-verify-downloads'); module.exports = (on, config) => { - on('task', { isFileExist, findFiles }) + on('task', verifyDownloadTasks) } ``` diff --git a/cypress.config.js b/cypress.config.js index 8af20f8..71f8fde 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -1,10 +1,10 @@ const { defineConfig } = require('cypress'); -const { isFileExist, findFiles } = require('./src/index'); +const { verifyDownloadTasks } = require('./src/index'); module.exports = defineConfig({ e2e: { setupNodeEvents(on, config) { - on('task', { isFileExist, findFiles }); + on('task', verifyDownloadTasks); }, baseUrl: 'http://localhost:8039', }, diff --git a/src/index.js b/src/index.js index e644285..f1caa75 100644 --- a/src/index.js +++ b/src/index.js @@ -76,7 +76,12 @@ const findFiles = ({ path, fileName }) => { const isDownloaded = (file) => !file.endsWith('.crdownload'); module.exports = { + // TODO: deprecate these exports in the next major release isFileExist, findFiles, addCustomCommand, + verifyDownloadTasks: { + isFileExist, + findFiles, + }, };