Merge pull request #21694 from backstage/fix-bugs-in-init

fix: don't use commas for jest test files
This commit is contained in:
Fredrik Adelöw
2023-12-02 07:08:17 +01:00
committed by GitHub
4 changed files with 9 additions and 4 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/repo-tools': patch
---
Fixed a bug where `schema openapi init` created an invalid test command.
@@ -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')) {
+1 -1
View File
@@ -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"
+1 -1
View File
@@ -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"