@@ -33,7 +33,6 @@ import {
3333 TEST_TIMEOUT ,
3434 testDeploymentCommitMessage ,
3535 testGitCommitMessage ,
36- waitForExit ,
3736} from "./helpers" ;
3837import type { TemplateConfig } from "../src/templates" ;
3938import type { RunnerConfig } from "./helpers" ;
@@ -45,16 +44,10 @@ type FrameworkTestConfig = RunnerConfig & {
4544 nodeCompat : boolean ;
4645 unsupportedPms ?: string [ ] ;
4746 unsupportedOSs ?: string [ ] ;
48- verifyBuild ?: {
49- outputDir : string ;
50- script : string ;
51- route : string ;
52- expectedText : string ;
53- } ;
5447 flags ?: string [ ] ;
5548} ;
5649
57- const { name : pm , npx } = detectPackageManager ( ) ;
50+ const { name : pm } = detectPackageManager ( ) ;
5851
5952function getFrameworkTests ( opts : {
6053 experimental : boolean ;
@@ -180,7 +173,6 @@ describe.concurrent(
180173 ) ;
181174
182175 await verifyTypes ( testConfig , frameworkConfig , project . path ) ;
183- await verifyBuildScript ( testConfig , project . path , logStream ) ;
184176 } catch ( e ) {
185177 console . error ( "ERROR" , e ) ;
186178 expect . fail (
@@ -404,59 +396,6 @@ const verifyTypes = async (
404396 }
405397} ;
406398
407- const verifyBuildScript = async (
408- { verifyBuild } : FrameworkTestConfig ,
409- projectPath : string ,
410- logStream : Writable ,
411- ) => {
412- if ( ! verifyBuild ) {
413- return ;
414- }
415-
416- const { outputDir, script, route, expectedText } = verifyBuild ;
417-
418- // Run the build scripts
419- const buildProc = spawnWithLogging (
420- [ pm , "run" , script ] ,
421- {
422- cwd : projectPath ,
423- env : {
424- NODE_ENV : "production" ,
425- } ,
426- } ,
427- logStream ,
428- ) ;
429- await waitForExit ( buildProc ) ;
430-
431- // Run wrangler dev on a random port to avoid colliding with other tests
432- const TEST_PORT = Math . ceil ( Math . random ( ) * 1000 ) + 20000 ;
433-
434- const devProc = spawnWithLogging (
435- [ npx , "wrangler" , "pages" , "dev" , outputDir , "--port" , `${ TEST_PORT } ` ] ,
436- {
437- cwd : projectPath ,
438- } ,
439- logStream ,
440- ) ;
441-
442- // Wait a few seconds for dev server to spin up
443- await sleep ( 7000 ) ;
444-
445- // Make a request to the specified test route
446- const res = await fetch ( `http://127.0.0.1:${ TEST_PORT } ${ route } ` ) ;
447- const body = await res . text ( ) ;
448-
449- // Kill the process gracefully so ports can be cleaned up
450- await kill ( devProc ) ;
451-
452- // Wait for a second to allow process to exit cleanly. Otherwise, the port might
453- // end up camped and cause future runs to fail
454- await sleep ( 1000 ) ;
455-
456- // Verify expectation after killing the process so that it exits cleanly in case of failure
457- expect ( body ) . toContain ( expectedText ) ;
458- } ;
459-
460399function shouldRunTest ( frameworkId : string , testConfig : FrameworkTestConfig ) {
461400 const quarantineModeMatch =
462401 isQuarantineMode ( ) == ( testConfig . quarantine ?? false ) ;
0 commit comments