11import fs , { readFileSync } from "node:fs" ;
22import { basename } from "node:path" ;
3+ import { detectPackageManager } from "helpers/packageManagers" ;
34import { beforeAll , describe , expect } from "vitest" ;
45import { version } from "../package.json" ;
56import { getFrameworkToTest } from "./frameworkToTest" ;
@@ -14,7 +15,7 @@ import type { Suite } from "vitest";
1415
1516const experimental = process . env . E2E_EXPERIMENTAL === "true" ;
1617const frameworkToTest = getFrameworkToTest ( { experimental : false } ) ;
17-
18+ const { name : pm } = detectPackageManager ( ) ;
1819// Note: skipIf(frameworkToTest) makes it so that all the basic C3 functionality
1920// tests are skipped in case we are testing a specific framework
2021describe . skipIf ( experimental || frameworkToTest || isQuarantineMode ( ) ) (
@@ -421,5 +422,22 @@ describe.skipIf(experimental || frameworkToTest || isQuarantineMode())(
421422 expect ( output ) . toContain ( `lang JavaScript` ) ;
422423 } ,
423424 ) ;
425+
426+ test ( { experimental } ) . skipIf (
427+ process . platform === "win32" || pm === "yarn" ,
428+ ) ( "--existing-script" , async ( { logStream, project } ) => {
429+ const { output } = await runC3 (
430+ [
431+ project . path ,
432+ "--existing-script=existing-script-test-do-not-delete" ,
433+ "--git=false" ,
434+ "--no-deploy" ,
435+ ] ,
436+ [ ] ,
437+ logStream ,
438+ ) ;
439+ expect ( output ) . toContain ( "Pre-existing Worker (from Dashboard)" ) ;
440+ expect ( output ) . toContain ( "Application created successfully!" ) ;
441+ } ) ;
424442 } ,
425443) ;
0 commit comments