ember-codemod-pod-to-octane
Version:
Codemod to un-pod Ember apps, addons, and engines
19 lines (18 loc) • 650 B
JavaScript
import { findFiles } from '@codemod-utils/files';
import { renamePodPath } from '../../../../../utils/files/index.js';
export function mapComponents(options) {
const { projectRoot } = options;
const podDir = 'tests/integration/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];
});
}