UNPKG

ember-codemod-pod-to-octane

Version:

Codemod to un-pod Ember apps, addons, and engines

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