Invoke `npx tsx create-integration/index.ts` with argv-style args so none * of the slug / feature strings ever hit a shell parser. Previous revisions * used `execSync(string)` with interpolated slugs — safe today because the * slugs are constants, but a poor hygiene pattern worth stamping out.
(args: readonly string[])
| 174 | * Sets `CREATE_INTEGRATION_{PACKAGES,WORKFLOWS}_DIR` so the generator |
| 175 | * writes entirely inside our per-suite tmpdir. */ |
| 176 | function runGenerator(args: readonly string[]): { stdout: string } { |
| 177 | const baseOpts = execOptsFor(SCRIPTS_DIR); |
| 178 | const stdout = execFileSync( |
| 179 | "npx", |
| 180 | ["tsx", "create-integration/index.ts", ...args], |
| 181 | { |
| 182 | ...baseOpts, |
| 183 | env: { |
| 184 | ...process.env, |
| 185 | CREATE_INTEGRATION_PACKAGES_DIR: TMP_PACKAGES_DIR, |
| 186 | CREATE_INTEGRATION_WORKFLOWS_DIR: TMP_WORKFLOWS_DIR, |
| 187 | }, |
| 188 | }, |
| 189 | ); |
| 190 | return { stdout: stdout.toString() }; |
| 191 | } |
| 192 | |
| 193 | describe("Template Generator", () => { |
| 194 | it("generates a valid package structure", () => { |
no test coverage detected
searching dependent graphs…