diff --git a/src/migration/engine/index.ts b/src/migration/engine/index.ts deleted file mode 100644 index 4c4d3aa..0000000 --- a/src/migration/engine/index.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { moveFiles } from '@codemod-utils/files'; - -import type { CodemodOptions } from '../../types/index.js'; -import { createFilePathMaps, createOptions } from './steps/index.js'; - -export function migrateEngine(codemodOptions: CodemodOptions): void { - const options = createOptions(codemodOptions); - - const filePathMaps = createFilePathMaps(options); - - if (options.testRun) { - console.log(filePathMaps); - - return; - } - - // Preserve code - moveFiles(filePathMaps.addon, options); - moveFiles(filePathMaps.tests, options); -} diff --git a/src/migration/engine/steps/create-file-path-maps.ts b/src/migration/engine/steps/create-file-path-maps.ts deleted file mode 100644 index 9925c21..0000000 --- a/src/migration/engine/steps/create-file-path-maps.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { FilePathMap } from '@codemod-utils/files'; - -import type { Options } from '../../../types/index.js'; -import { mapAddonFolder } from './create-file-path-maps/addon/index.js'; -import { mapTestsFolder } from './create-file-path-maps/tests/index.js'; - -type FilePathMaps = { - addon: FilePathMap; - tests: FilePathMap; -}; - -export function createFilePathMaps(options: Options): FilePathMaps { - return { - addon: mapAddonFolder(options), - tests: mapTestsFolder(options), - }; -} diff --git a/src/migration/engine/steps/create-file-path-maps/addon/index.ts b/src/migration/engine/steps/create-file-path-maps/addon/index.ts deleted file mode 100644 index ecf888d..0000000 --- a/src/migration/engine/steps/create-file-path-maps/addon/index.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { FilePathMap, Options } from '../../../../../types/index.js'; -import { mapComponentClasses } from './map-component-classes.js'; -import { mapComponentStylesheets } from './map-component-stylesheets.js'; -import { mapComponentTemplates } from './map-component-templates.js'; -import { mapRouteControllers } from './map-route-controllers.js'; -import { mapRouteRoutes } from './map-route-routes.js'; -import { mapRouteStylesheets } from './map-route-stylesheets.js'; -import { mapRouteTemplates } from './map-route-templates.js'; - -export function mapAddonFolder(options: Options): FilePathMap { - return new Map([ - ...mapComponentClasses(options), - ...mapComponentStylesheets(options), - ...mapComponentTemplates(options), - ...mapRouteControllers(options), - ...mapRouteRoutes(options), - ...mapRouteStylesheets(options), - ...mapRouteTemplates(options), - ]); -} diff --git a/src/migration/engine/steps/create-file-path-maps/addon/map-component-classes.ts b/src/migration/engine/steps/create-file-path-maps/addon/map-component-classes.ts deleted file mode 100644 index d976c3c..0000000 --- a/src/migration/engine/steps/create-file-path-maps/addon/map-component-classes.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { findFiles } from '@codemod-utils/files'; - -import type { - FilePathMapEntries, - Options, -} from '../../../../../types/index.js'; -import { renamePodPath } from '../../../../../utils/files/index.js'; - -export function mapComponentClasses(options: Options): FilePathMapEntries { - const { projectRoot } = options; - - const filePaths = findFiles('addon/components/**/component.{d.ts,js,ts}', { - projectRoot, - }); - - return filePaths.map((oldFilePath) => { - const newFilePath = renamePodPath(oldFilePath, { - entityDir: 'addon/components', - replace: (key: string) => { - return `addon/components/${key}`; - }, - }); - - return [oldFilePath, newFilePath]; - }); -} diff --git a/src/migration/engine/steps/create-file-path-maps/addon/map-component-stylesheets.ts b/src/migration/engine/steps/create-file-path-maps/addon/map-component-stylesheets.ts deleted file mode 100644 index 877682a..0000000 --- a/src/migration/engine/steps/create-file-path-maps/addon/map-component-stylesheets.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { findFiles } from '@codemod-utils/files'; - -import type { - FilePathMapEntries, - Options, -} from '../../../../../types/index.js'; -import { renamePodPath } from '../../../../../utils/files/index.js'; - -export function mapComponentStylesheets(options: Options): FilePathMapEntries { - const { projectRoot } = options; - - const filePaths = findFiles('addon/components/**/styles.{css,scss}', { - projectRoot, - }); - - return filePaths.map((oldFilePath) => { - const newFilePath = renamePodPath(oldFilePath, { - entityDir: 'addon/components', - replace: (key: string) => { - return `addon/components/${key}`; - }, - }); - - return [oldFilePath, newFilePath]; - }); -} diff --git a/src/migration/engine/steps/create-file-path-maps/addon/map-component-templates.ts b/src/migration/engine/steps/create-file-path-maps/addon/map-component-templates.ts deleted file mode 100644 index 956a535..0000000 --- a/src/migration/engine/steps/create-file-path-maps/addon/map-component-templates.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { findFiles } from '@codemod-utils/files'; - -import type { - FilePathMapEntries, - Options, -} from '../../../../../types/index.js'; -import { renamePodPath } from '../../../../../utils/files/index.js'; - -export function mapComponentTemplates(options: Options): FilePathMapEntries { - const { projectRoot } = options; - - const filePaths = findFiles('addon/components/**/template.hbs', { - projectRoot, - }); - - return filePaths.map((oldFilePath) => { - const newFilePath = renamePodPath(oldFilePath, { - entityDir: 'addon/components', - replace: (key: string) => { - return `addon/components/${key}`; - }, - }); - - return [oldFilePath, newFilePath]; - }); -} diff --git a/src/migration/engine/steps/create-file-path-maps/addon/map-route-controllers.ts b/src/migration/engine/steps/create-file-path-maps/addon/map-route-controllers.ts deleted file mode 100644 index 96b4704..0000000 --- a/src/migration/engine/steps/create-file-path-maps/addon/map-route-controllers.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { findFiles } from '@codemod-utils/files'; - -import type { - FilePathMapEntries, - Options, -} from '../../../../../types/index.js'; -import { renamePodPath } from '../../../../../utils/files/index.js'; - -export function mapRouteControllers(options: Options): FilePathMapEntries { - const { projectRoot } = options; - - const filePaths = findFiles('addon/**/controller.{js,ts}', { - projectRoot, - }); - - return filePaths.map((oldFilePath) => { - const newFilePath = renamePodPath(oldFilePath, { - entityDir: 'addon', - replace: (key: string) => { - return `addon/controllers/${key}`; - }, - }); - - return [oldFilePath, newFilePath]; - }); -} diff --git a/src/migration/engine/steps/create-file-path-maps/addon/map-route-routes.ts b/src/migration/engine/steps/create-file-path-maps/addon/map-route-routes.ts deleted file mode 100644 index 3009a9f..0000000 --- a/src/migration/engine/steps/create-file-path-maps/addon/map-route-routes.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { findFiles } from '@codemod-utils/files'; - -import type { - FilePathMapEntries, - Options, -} from '../../../../../types/index.js'; -import { renamePodPath } from '../../../../../utils/files/index.js'; - -export function mapRouteRoutes(options: Options): FilePathMapEntries { - const { projectRoot } = options; - - const filePaths = findFiles('addon/**/route.{js,ts}', { - projectRoot, - }); - - return filePaths.map((oldFilePath) => { - const newFilePath = renamePodPath(oldFilePath, { - entityDir: 'addon', - replace: (key: string) => { - return `addon/routes/${key}`; - }, - }); - - return [oldFilePath, newFilePath]; - }); -} diff --git a/src/migration/engine/steps/create-file-path-maps/addon/map-route-stylesheets.ts b/src/migration/engine/steps/create-file-path-maps/addon/map-route-stylesheets.ts deleted file mode 100644 index 40434e5..0000000 --- a/src/migration/engine/steps/create-file-path-maps/addon/map-route-stylesheets.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { findFiles } from '@codemod-utils/files'; - -import type { - FilePathMapEntries, - Options, -} from '../../../../../types/index.js'; -import { renamePodPath } from '../../../../../utils/files/index.js'; - -export function mapRouteStylesheets(options: Options): FilePathMapEntries { - const { projectRoot } = options; - - const filePaths = findFiles('addon/!(components)/**/styles.{css,scss}', { - projectRoot, - }); - - return filePaths.map((oldFilePath) => { - const newFilePath = renamePodPath(oldFilePath, { - entityDir: 'addon', - replace: (key: string) => { - return `addon/styles/${key}`; - }, - }); - - return [oldFilePath, newFilePath]; - }); -} diff --git a/src/migration/engine/steps/create-file-path-maps/addon/map-route-templates.ts b/src/migration/engine/steps/create-file-path-maps/addon/map-route-templates.ts deleted file mode 100644 index 302c4f4..0000000 --- a/src/migration/engine/steps/create-file-path-maps/addon/map-route-templates.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { findFiles } from '@codemod-utils/files'; - -import type { - FilePathMapEntries, - Options, -} from '../../../../../types/index.js'; -import { renamePodPath } from '../../../../../utils/files/index.js'; - -export function mapRouteTemplates(options: Options): FilePathMapEntries { - const { projectRoot } = options; - - const filePaths = findFiles('addon/!(components)/**/template.hbs', { - projectRoot, - }); - - return filePaths.map((oldFilePath) => { - const newFilePath = renamePodPath(oldFilePath, { - entityDir: 'addon', - replace: (key: string) => { - return `addon/templates/${key}`; - }, - }); - - return [oldFilePath, newFilePath]; - }); -} diff --git a/src/migration/engine/steps/create-file-path-maps/tests/index.ts b/src/migration/engine/steps/create-file-path-maps/tests/index.ts deleted file mode 100644 index 1f141ff..0000000 --- a/src/migration/engine/steps/create-file-path-maps/tests/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { FilePathMap, Options } from '../../../../../types/index.js'; -import { mapComponents } from './map-components.js'; -import { mapRouteControllers } from './map-route-controllers.js'; -import { mapRouteRoutes } from './map-route-routes.js'; - -export function mapTestsFolder(options: Options): FilePathMap { - return new Map([ - ...mapComponents(options), - ...mapRouteControllers(options), - ...mapRouteRoutes(options), - ]); -} diff --git a/src/migration/engine/steps/create-file-path-maps/tests/map-components.ts b/src/migration/engine/steps/create-file-path-maps/tests/map-components.ts deleted file mode 100644 index 95f2658..0000000 --- a/src/migration/engine/steps/create-file-path-maps/tests/map-components.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { findFiles } from '@codemod-utils/files'; - -import type { - FilePathMapEntries, - Options, -} from '../../../../../types/index.js'; -import { renamePodPath } from '../../../../../utils/files/index.js'; - -export function mapComponents(options: Options): FilePathMapEntries { - const { projectRoot } = options; - - const filePaths = findFiles( - 'tests/integration/components/**/component-test.{js,ts}', - { - projectRoot, - }, - ); - - return filePaths.map((oldFilePath) => { - const newFilePath = renamePodPath(oldFilePath, { - entityDir: 'tests/integration/components', - replace: (key: string) => { - return `tests/integration/components/${key}-test`; - }, - }); - - return [oldFilePath, newFilePath]; - }); -} diff --git a/src/migration/engine/steps/create-file-path-maps/tests/map-route-controllers.ts b/src/migration/engine/steps/create-file-path-maps/tests/map-route-controllers.ts deleted file mode 100644 index 6373948..0000000 --- a/src/migration/engine/steps/create-file-path-maps/tests/map-route-controllers.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { findFiles } from '@codemod-utils/files'; - -import type { - FilePathMapEntries, - Options, -} from '../../../../../types/index.js'; -import { renamePodPath } from '../../../../../utils/files/index.js'; - -export function mapRouteControllers(options: Options): FilePathMapEntries { - const { projectRoot } = options; - - /* - Case 1: Didn't pass the --pod flag, but configured { usePods: true } in .ember-cli - */ - const filePaths1 = findFiles( - 'tests/unit/!(controllers)/**/controller-test.{js,ts}', - { - projectRoot, - }, - ); - - const filePathMap1 = filePaths1.map((oldFilePath) => { - const newFilePath = renamePodPath(oldFilePath, { - entityDir: 'tests/unit', - replace: (key: string) => { - return `tests/unit/controllers/${key}-test`; - }, - }); - - return [oldFilePath, newFilePath]; - }); - - /* - Case 2: Passed the --pod flag to Ember CLI - */ - const filePaths2 = findFiles( - 'tests/unit/controllers/**/controller-test.{js,ts}', - { - projectRoot, - }, - ); - - const filePathMap2 = filePaths2.map((oldFilePath) => { - const newFilePath = renamePodPath(oldFilePath, { - entityDir: 'tests/unit/controllers', - replace: (key: string) => { - return `tests/unit/controllers/${key}-test`; - }, - }); - - return [oldFilePath, newFilePath]; - }); - - return [...filePathMap1, ...filePathMap2] as FilePathMapEntries; -} diff --git a/src/migration/engine/steps/create-file-path-maps/tests/map-route-routes.ts b/src/migration/engine/steps/create-file-path-maps/tests/map-route-routes.ts deleted file mode 100644 index 4ea3f38..0000000 --- a/src/migration/engine/steps/create-file-path-maps/tests/map-route-routes.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { findFiles } from '@codemod-utils/files'; - -import type { - FilePathMapEntries, - Options, -} from '../../../../../types/index.js'; -import { renamePodPath } from '../../../../../utils/files/index.js'; - -export function mapRouteRoutes(options: Options): FilePathMapEntries { - const { projectRoot } = options; - - /* - Case 1: Didn't pass the --pod flag, but configured { usePods: true } in .ember-cli - */ - const filePaths1 = findFiles('tests/unit/!(routes)/**/route-test.{js,ts}', { - projectRoot, - }); - - const filePathMap1 = filePaths1.map((oldFilePath) => { - const newFilePath = renamePodPath(oldFilePath, { - entityDir: 'tests/unit', - replace: (key: string) => { - return `tests/unit/routes/${key}-test`; - }, - }); - - return [oldFilePath, newFilePath]; - }); - - /* - Case 2: Passed the --pod flag to Ember CLI - */ - const filePaths2 = findFiles('tests/unit/routes/**/route-test.{js,ts}', { - projectRoot, - }); - - const filePathMap2 = filePaths2.map((oldFilePath) => { - const newFilePath = renamePodPath(oldFilePath, { - entityDir: 'tests/unit/routes', - replace: (key: string) => { - return `tests/unit/routes/${key}-test`; - }, - }); - - return [oldFilePath, newFilePath]; - }); - - return [...filePathMap1, ...filePathMap2] as FilePathMapEntries; -} diff --git a/src/migration/engine/steps/create-options.ts b/src/migration/engine/steps/create-options.ts deleted file mode 100644 index c061edc..0000000 --- a/src/migration/engine/steps/create-options.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { CodemodOptions, Options } from '../../../types/index.js'; - -export function createOptions(codemodOptions: CodemodOptions): Options { - return { - podPath: codemodOptions.podPath, - projectRoot: codemodOptions.projectRoot, - projectType: codemodOptions.projectType, - testRun: codemodOptions.testRun, - }; -} diff --git a/src/migration/engine/steps/index.ts b/src/migration/engine/steps/index.ts deleted file mode 100644 index 9508e1c..0000000 --- a/src/migration/engine/steps/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './create-file-path-maps.js'; -export * from './create-options.js'; diff --git a/tests/migration/engine/steps/create-file-path-maps/javascript.test.ts b/tests/migration/engine/steps/create-file-path-maps/javascript.test.ts deleted file mode 100644 index 8bc902e..0000000 --- a/tests/migration/engine/steps/create-file-path-maps/javascript.test.ts +++ /dev/null @@ -1,121 +0,0 @@ -import { assert, loadFixture, test } from '@codemod-utils/tests'; - -import { createFilePathMaps } from '../../../../../src/migration/engine/steps/index.js'; -import { inputProject } from '../../../../fixtures/engine/javascript/index.js'; -import { - codemodOptions, - options, -} from '../../../../helpers/shared-test-setups/engine/javascript.js'; - -test('migration | engine | steps | create-file-path-maps > javascript', function () { - loadFixture(inputProject, codemodOptions); - - const filePathMaps = createFilePathMaps(options); - - assert.deepStrictEqual( - filePathMaps.addon, - new Map([ - [ - 'addon/components/product/card/styles.css', - 'addon/components/product/card.css', - ], - [ - 'addon/components/product/card/template.hbs', - 'addon/components/product/card.hbs', - ], - [ - 'addon/components/product/details/component.js', - 'addon/components/product/details.js', - ], - [ - 'addon/components/product/details/styles.css', - 'addon/components/product/details.css', - ], - [ - 'addon/components/product/details/template.hbs', - 'addon/components/product/details.hbs', - ], - [ - 'addon/components/product/image/component.js', - 'addon/components/product/image.js', - ], - [ - 'addon/components/product/image/styles.css', - 'addon/components/product/image.css', - ], - [ - 'addon/components/product/image/template.hbs', - 'addon/components/product/image.hbs', - ], - ['addon/product-details/route.js', 'addon/routes/product-details.js'], - ['addon/product-details/styles.css', 'addon/styles/product-details.css'], - [ - 'addon/product-details/template.hbs', - 'addon/templates/product-details.hbs', - ], - ['addon/products/controller.js', 'addon/controllers/products.js'], - ['addon/products/product/route.js', 'addon/routes/products/product.js'], - [ - 'addon/products/product/styles.css', - 'addon/styles/products/product.css', - ], - [ - 'addon/products/product/template.hbs', - 'addon/templates/products/product.hbs', - ], - ['addon/products/route.js', 'addon/routes/products.js'], - ['addon/products/styles.css', 'addon/styles/products.css'], - ['addon/products/template.hbs', 'addon/templates/products.hbs'], - ]), - ); - - assert.deepStrictEqual( - filePathMaps.tests, - new Map([ - [ - 'tests/integration/components/product/card/component-test.js', - 'tests/integration/components/product/card-test.js', - ], - [ - 'tests/integration/components/product/details/component-test.js', - 'tests/integration/components/product/details-test.js', - ], - [ - 'tests/integration/components/product/image/component-test.js', - 'tests/integration/components/product/image-test.js', - ], - [ - 'tests/unit/controllers/products/controller-test.js', - 'tests/unit/controllers/products-test.js', - ], - [ - 'tests/unit/product-details/route-test.js', - 'tests/unit/routes/product-details-test.js', - ], - [ - 'tests/unit/products/product/route-test.js', - 'tests/unit/routes/products/product-test.js', - ], - [ - 'tests/unit/products/route-test.js', - 'tests/unit/routes/products-test.js', - ], - [ - 'tests/unit/routes/product-details/route-test.js', - 'tests/unit/routes/product-details-test.js', - ], - [ - 'tests/unit/products/controller-test.js', - 'tests/unit/controllers/products-test.js', - ], - [ - 'tests/unit/routes/products/product/route-test.js', - 'tests/unit/routes/products/product-test.js', - ], - [ - 'tests/unit/routes/products/route-test.js', - 'tests/unit/routes/products-test.js', - ], - ]), - ); -}); diff --git a/tests/migration/engine/steps/create-file-path-maps/sass.test.ts b/tests/migration/engine/steps/create-file-path-maps/sass.test.ts deleted file mode 100644 index 8188dcd..0000000 --- a/tests/migration/engine/steps/create-file-path-maps/sass.test.ts +++ /dev/null @@ -1,124 +0,0 @@ -import { assert, loadFixture, test } from '@codemod-utils/tests'; - -import { createFilePathMaps } from '../../../../../src/migration/engine/steps/index.js'; -import { inputProject } from '../../../../fixtures/engine/sass/index.js'; -import { - codemodOptions, - options, -} from '../../../../helpers/shared-test-setups/engine/sass.js'; - -test('migration | engine | steps | create-file-path-maps > sass', function () { - loadFixture(inputProject, codemodOptions); - - const filePathMaps = createFilePathMaps(options); - - assert.deepStrictEqual( - filePathMaps.addon, - new Map([ - [ - 'addon/components/product/card/styles.scss', - 'addon/components/product/card.scss', - ], - [ - 'addon/components/product/card/template.hbs', - 'addon/components/product/card.hbs', - ], - [ - 'addon/components/product/details/component.js', - 'addon/components/product/details.js', - ], - [ - 'addon/components/product/details/styles.scss', - 'addon/components/product/details.scss', - ], - [ - 'addon/components/product/details/template.hbs', - 'addon/components/product/details.hbs', - ], - [ - 'addon/components/product/image/component.js', - 'addon/components/product/image.js', - ], - [ - 'addon/components/product/image/styles.scss', - 'addon/components/product/image.scss', - ], - [ - 'addon/components/product/image/template.hbs', - 'addon/components/product/image.hbs', - ], - ['addon/product-details/route.js', 'addon/routes/product-details.js'], - [ - 'addon/product-details/styles.scss', - 'addon/styles/product-details.scss', - ], - [ - 'addon/product-details/template.hbs', - 'addon/templates/product-details.hbs', - ], - ['addon/products/controller.js', 'addon/controllers/products.js'], - ['addon/products/product/route.js', 'addon/routes/products/product.js'], - [ - 'addon/products/product/styles.scss', - 'addon/styles/products/product.scss', - ], - [ - 'addon/products/product/template.hbs', - 'addon/templates/products/product.hbs', - ], - ['addon/products/route.js', 'addon/routes/products.js'], - ['addon/products/styles.scss', 'addon/styles/products.scss'], - ['addon/products/template.hbs', 'addon/templates/products.hbs'], - ]), - ); - - assert.deepStrictEqual( - filePathMaps.tests, - new Map([ - [ - 'tests/integration/components/product/card/component-test.js', - 'tests/integration/components/product/card-test.js', - ], - [ - 'tests/integration/components/product/details/component-test.js', - 'tests/integration/components/product/details-test.js', - ], - [ - 'tests/integration/components/product/image/component-test.js', - 'tests/integration/components/product/image-test.js', - ], - [ - 'tests/unit/controllers/products/controller-test.js', - 'tests/unit/controllers/products-test.js', - ], - [ - 'tests/unit/product-details/route-test.js', - 'tests/unit/routes/product-details-test.js', - ], - [ - 'tests/unit/products/product/route-test.js', - 'tests/unit/routes/products/product-test.js', - ], - [ - 'tests/unit/products/route-test.js', - 'tests/unit/routes/products-test.js', - ], - [ - 'tests/unit/routes/product-details/route-test.js', - 'tests/unit/routes/product-details-test.js', - ], - [ - 'tests/unit/products/controller-test.js', - 'tests/unit/controllers/products-test.js', - ], - [ - 'tests/unit/routes/products/product/route-test.js', - 'tests/unit/routes/products/product-test.js', - ], - [ - 'tests/unit/routes/products/route-test.js', - 'tests/unit/routes/products-test.js', - ], - ]), - ); -}); diff --git a/tests/migration/engine/steps/create-file-path-maps/typescript.test.ts b/tests/migration/engine/steps/create-file-path-maps/typescript.test.ts deleted file mode 100644 index 749bee5..0000000 --- a/tests/migration/engine/steps/create-file-path-maps/typescript.test.ts +++ /dev/null @@ -1,125 +0,0 @@ -import { assert, loadFixture, test } from '@codemod-utils/tests'; - -import { createFilePathMaps } from '../../../../../src/migration/engine/steps/index.js'; -import { inputProject } from '../../../../fixtures/engine/typescript/index.js'; -import { - codemodOptions, - options, -} from '../../../../helpers/shared-test-setups/engine/typescript.js'; - -test('migration | engine | steps | create-file-path-maps > typescript', function () { - loadFixture(inputProject, codemodOptions); - - const filePathMaps = createFilePathMaps(options); - - assert.deepStrictEqual( - filePathMaps.addon, - new Map([ - [ - 'addon/components/product/card/component.d.ts', - 'addon/components/product/card.d.ts', - ], - [ - 'addon/components/product/card/styles.css', - 'addon/components/product/card.css', - ], - [ - 'addon/components/product/card/template.hbs', - 'addon/components/product/card.hbs', - ], - [ - 'addon/components/product/details/component.ts', - 'addon/components/product/details.ts', - ], - [ - 'addon/components/product/details/styles.css', - 'addon/components/product/details.css', - ], - [ - 'addon/components/product/details/template.hbs', - 'addon/components/product/details.hbs', - ], - [ - 'addon/components/product/image/component.ts', - 'addon/components/product/image.ts', - ], - [ - 'addon/components/product/image/styles.css', - 'addon/components/product/image.css', - ], - [ - 'addon/components/product/image/template.hbs', - 'addon/components/product/image.hbs', - ], - ['addon/product-details/route.ts', 'addon/routes/product-details.ts'], - ['addon/product-details/styles.css', 'addon/styles/product-details.css'], - [ - 'addon/product-details/template.hbs', - 'addon/templates/product-details.hbs', - ], - ['addon/products/controller.ts', 'addon/controllers/products.ts'], - ['addon/products/product/route.ts', 'addon/routes/products/product.ts'], - [ - 'addon/products/product/styles.css', - 'addon/styles/products/product.css', - ], - [ - 'addon/products/product/template.hbs', - 'addon/templates/products/product.hbs', - ], - ['addon/products/route.ts', 'addon/routes/products.ts'], - ['addon/products/styles.css', 'addon/styles/products.css'], - ['addon/products/template.hbs', 'addon/templates/products.hbs'], - ]), - ); - - assert.deepStrictEqual( - filePathMaps.tests, - new Map([ - [ - 'tests/integration/components/product/card/component-test.ts', - 'tests/integration/components/product/card-test.ts', - ], - [ - 'tests/integration/components/product/details/component-test.ts', - 'tests/integration/components/product/details-test.ts', - ], - [ - 'tests/integration/components/product/image/component-test.ts', - 'tests/integration/components/product/image-test.ts', - ], - [ - 'tests/unit/controllers/products/controller-test.ts', - 'tests/unit/controllers/products-test.ts', - ], - [ - 'tests/unit/product-details/route-test.ts', - 'tests/unit/routes/product-details-test.ts', - ], - [ - 'tests/unit/products/product/route-test.ts', - 'tests/unit/routes/products/product-test.ts', - ], - [ - 'tests/unit/products/route-test.ts', - 'tests/unit/routes/products-test.ts', - ], - [ - 'tests/unit/routes/product-details/route-test.ts', - 'tests/unit/routes/product-details-test.ts', - ], - [ - 'tests/unit/products/controller-test.ts', - 'tests/unit/controllers/products-test.ts', - ], - [ - 'tests/unit/routes/products/product/route-test.ts', - 'tests/unit/routes/products/product-test.ts', - ], - [ - 'tests/unit/routes/products/route-test.ts', - 'tests/unit/routes/products-test.ts', - ], - ]), - ); -}); diff --git a/tests/migration/engine/steps/create-options/javascript.test.ts b/tests/migration/engine/steps/create-options/javascript.test.ts deleted file mode 100644 index b6baaf2..0000000 --- a/tests/migration/engine/steps/create-options/javascript.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { assert, loadFixture, test } from '@codemod-utils/tests'; - -import { createOptions } from '../../../../../src/migration/engine/steps/index.js'; -import { inputProject } from '../../../../fixtures/engine/javascript/index.js'; -import { - codemodOptions, - options, -} from '../../../../helpers/shared-test-setups/engine/javascript.js'; - -test('migration | engine | steps | create-options > javascript', function () { - loadFixture(inputProject, codemodOptions); - - assert.deepStrictEqual(createOptions(codemodOptions), options); -}); diff --git a/tests/migration/engine/steps/create-options/sass.test.ts b/tests/migration/engine/steps/create-options/sass.test.ts deleted file mode 100644 index 9de4bf6..0000000 --- a/tests/migration/engine/steps/create-options/sass.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { assert, loadFixture, test } from '@codemod-utils/tests'; - -import { createOptions } from '../../../../../src/migration/engine/steps/index.js'; -import { inputProject } from '../../../../fixtures/engine/sass/index.js'; -import { - codemodOptions, - options, -} from '../../../../helpers/shared-test-setups/engine/sass.js'; - -test('migration | engine | steps | create-options > sass', function () { - loadFixture(inputProject, codemodOptions); - - assert.deepStrictEqual(createOptions(codemodOptions), options); -}); diff --git a/tests/migration/engine/steps/create-options/typescript.test.ts b/tests/migration/engine/steps/create-options/typescript.test.ts deleted file mode 100644 index 7ab2b83..0000000 --- a/tests/migration/engine/steps/create-options/typescript.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { assert, loadFixture, test } from '@codemod-utils/tests'; - -import { createOptions } from '../../../../../src/migration/engine/steps/index.js'; -import { inputProject } from '../../../../fixtures/engine/typescript/index.js'; -import { - codemodOptions, - options, -} from '../../../../helpers/shared-test-setups/engine/typescript.js'; - -test('migration | engine | steps | create-options > typescript', function () { - loadFixture(inputProject, codemodOptions); - - assert.deepStrictEqual(createOptions(codemodOptions), options); -});