UNPKG

ember-codemod-pod-to-octane

Version:
20 lines (19 loc) 711 B
import { join } from 'node:path'; import { findFiles } from '@codemod-utils/files'; import { renamePodPath } from '../../../../../utils/files/index.js'; export function mapComponents(options) { const { podPath, projectRoot } = options; const podDir = join('tests/integration', podPath, 'components'); const filePaths = findFiles(`${podDir}/**/component-test.{js,ts}`, { projectRoot, }); return filePaths.map((oldFilePath) => { const newFilePath = renamePodPath(oldFilePath, { podDir, replace: (key) => { return `tests/integration/components/${key}-test`; }, }); return [oldFilePath, newFilePath]; }); }