From f49e2372d030997d47c851667a297de21917ab87 Mon Sep 17 00:00:00 2001 From: Aramis Sennyey Date: Fri, 1 Dec 2023 14:01:52 -0500 Subject: [PATCH] fix: don't use commas for jest test files Signed-off-by: Aramis Sennyey --- .changeset/late-hats-beam.md | 5 +++++ packages/repo-tools/src/commands/openapi/test/init.ts | 4 ++-- plugins/catalog-backend/optic.yml | 2 +- plugins/search-backend/optic.yml | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .changeset/late-hats-beam.md diff --git a/.changeset/late-hats-beam.md b/.changeset/late-hats-beam.md new file mode 100644 index 0000000000..7ba20d743a --- /dev/null +++ b/.changeset/late-hats-beam.md @@ -0,0 +1,5 @@ +--- +'@backstage/repo-tools': patch +--- + +Fixed a bug where `schema openapi init` created an invalid test command. diff --git a/packages/repo-tools/src/commands/openapi/test/init.ts b/packages/repo-tools/src/commands/openapi/test/init.ts index 13c3aeb2b6..a38416aabb 100644 --- a/packages/repo-tools/src/commands/openapi/test/init.ts +++ b/packages/repo-tools/src/commands/openapi/test/init.ts @@ -35,7 +35,7 @@ async function init(directoryPath: string) { ); } const opticConfigFilePath = join(directoryPath, 'optic.yml'); - if (!(await fs.pathExists(opticConfigFilePath))) { + if (await fs.pathExists(opticConfigFilePath)) { throw new Error(`This directory already has an optic.yml file. Exiting.`); } await fs.writeFile( @@ -56,7 +56,7 @@ capture: # 🔧 Specify a command that will generate traffic command: yarn backstage-cli package test --no-watch ${ROUTER_TEST_PATHS.map( e => `"${e}"`, - ).join(',')} + ).join(' ')} `, ); if (await cliPaths.resolveTargetRoot('node_modules/.bin/prettier')) { diff --git a/plugins/catalog-backend/optic.yml b/plugins/catalog-backend/optic.yml index 8b0c050516..dbbdefcf68 100644 --- a/plugins/catalog-backend/optic.yml +++ b/plugins/catalog-backend/optic.yml @@ -12,4 +12,4 @@ capture: # â„šī¸ Requests should be sent to the Optic proxy, the address of which is injected into 'run.command's env as OPTIC_PROXY (or the value of 'run.proxy_variable'). run: # 🔧 Specify a command that will generate traffic - command: yarn backstage-cli package test --no-watch src/service/router.test.ts src/service/createRouter.test.ts + command: yarn backstage-cli package test --no-watch "src/service/router.test.ts" "src/service/createRouter.test.ts" diff --git a/plugins/search-backend/optic.yml b/plugins/search-backend/optic.yml index 8f38d46f13..75f20f1bb8 100644 --- a/plugins/search-backend/optic.yml +++ b/plugins/search-backend/optic.yml @@ -12,4 +12,4 @@ capture: # â„šī¸ Requests should be sent to the Optic proxy, the address of which is injected into 'run.command's env as OPTIC_PROXY (or the value of 'run.proxy_variable'). run: # 🔧 Specify a command that will generate traffic - command: yarn backstage-cli package test --no-watch src/service/router.test.ts src/service/createRouter.test.ts + command: yarn backstage-cli package test --no-watch "src/service/router.test.ts" "src/service/createRouter.test.ts"