ember-codemod-pod-to-octane
Version:
Codemod to un-pod Ember apps, addons, and engines
20 lines (19 loc) • 667 B
JavaScript
import { findFiles } from '@codemod-utils/files';
import { renamePodPath } from '../../../../../utils/files/index.js';
export function mapServices(options) {
const { projectRoot } = options;
const podDir = 'tests/unit';
const filePaths = findFiles(`${podDir}/**/service-test.{js,ts}`, {
ignoreList: ['tests/unit/services/**'],
projectRoot,
});
return filePaths.map((oldFilePath) => {
const newFilePath = renamePodPath(oldFilePath, {
podDir,
replace: (key) => {
return `tests/unit/services/${key}-test`;
},
});
return [oldFilePath, newFilePath];
});
}