UNPKG

ember-codemod-pod-to-octane

Version:
20 lines (19 loc) 667 B
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]; }); }