export function getModules(files) { const CYPRESS_PREFIX = 'test/cypress/integration/'; const CYPRESS_SUFIX = '/**/*.spec.js'; const modules = []; for (const file of files) { if (file.startsWith('src/page')) modules.push( CYPRESS_PREFIX + lowercaseFirstLetter(file.split('/')[2]) + CYPRESS_SUFIX, ); if (file.startsWith('src/components')) modules.push(`${CYPRESS_PREFIX}vnComponent${CYPRESS_SUFIX}`); } return modules; } function lowercaseFirstLetter(str) { if (!str) return ''; // FIXME: https://redmine.verdnatura.es/issues/9022 return str.charAt(0).toLowerCase() + str.slice(1); }