diff --git a/src/steps/move-addon-files.ts b/src/steps/move-addon-files.ts index 6708ed98..b13020ba 100644 --- a/src/steps/move-addon-files.ts +++ b/src/steps/move-addon-files.ts @@ -25,7 +25,19 @@ function moveAddonFolder(options: Options): void { function moveAddonTestSupportFolder(options: Options): void { const { locations, projectRoot } = options; - const filePaths = findFiles('addon-test-support/**/*', { + let filePaths = findFiles('addon-test-support/index.{js,ts}', { + projectRoot, + }); + + if (filePaths.length === 1) { + const oldPath = filePaths[0]!; + const newPath = `${locations.addon}/src/test-support${oldPath.endsWith('.ts') ? '.ts' : 'js'}`; + + moveFiles(new Map([[oldPath, newPath]]), options); + } + + filePaths = findFiles('addon-test-support/**/*', { + ignoreList: ['addon-test-support/index.{js,ts}'], projectRoot, }); diff --git a/tests/fixtures/hello-world/output/hello-world/src/test-support/index.ts b/tests/fixtures/hello-world/output/hello-world/src/test-support.ts similarity index 100% rename from tests/fixtures/hello-world/output/hello-world/src/test-support/index.ts rename to tests/fixtures/hello-world/output/hello-world/src/test-support.ts diff --git a/tests/steps/move-addon-files/test-support.test.ts b/tests/steps/move-addon-files/test-support.test.ts index 9858602e..4a76198c 100644 --- a/tests/steps/move-addon-files/test-support.test.ts +++ b/tests/steps/move-addon-files/test-support.test.ts @@ -23,8 +23,8 @@ test('steps | move-addon-files > test-support', function () { components: { 'container-query.ts': '', }, - 'index.ts': `export * from './components/container-query';\n`, }, + 'test-support.ts': `export * from './components/container-query';\n`, }, }, };