File tree Expand file tree Collapse file tree 3 files changed +30
-2
lines changed Expand file tree Collapse file tree 3 files changed +30
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " wrangler " : patch
3+ ---
4+
5+ fix: Generalize autoconfig wording
6+
7+ Generalize the autoconfig wording so that when it doesn't specifically mention "deployment" (since it can be run via ` wrangler setup ` or the autoconfig programmatic API)
Original file line number Diff line number Diff line change @@ -340,5 +340,24 @@ describe("autoconfig (deploy)", () => {
340340 "
341341 ` ) ;
342342 } ) ;
343+
344+ it ( "errors if no output directory is specified in the autoconfig details" , async ( ) => {
345+ mockConfirm ( {
346+ text : "Do you want to modify these settings?" ,
347+ result : false ,
348+ } ) ;
349+
350+ await expect (
351+ run . runAutoConfig ( {
352+ projectPath : process . cwd ( ) ,
353+ configured : false ,
354+ framework : new Static ( "static" ) ,
355+ workerName : "my-worker" ,
356+ outputDir : "" ,
357+ } )
358+ ) . rejects . toThrowErrorMatchingInlineSnapshot (
359+ `[Error: Cannot configure project without an output directory]`
360+ ) ;
361+ } ) ;
343362 } ) ;
344363} ) ;
Original file line number Diff line number Diff line change @@ -59,7 +59,9 @@ export async function runAutoConfig(
5959 autoConfigDetails = updatedAutoConfigDetails ;
6060
6161 if ( ! autoConfigDetails . outputDir ) {
62- throw new FatalError ( "Cannot deploy project without an output directory" ) ;
62+ throw new FatalError (
63+ "Cannot configure project without an output directory"
64+ ) ;
6365 }
6466
6567 const wranglerConfig : RawConfig = {
@@ -82,7 +84,7 @@ export async function runAutoConfig(
8284 } ) ;
8385
8486 if ( ! ( skipConfirmations || ( await confirm ( "Proceed with setup?" ) ) ) ) {
85- throw new FatalError ( "Deployment aborted " ) ;
87+ throw new FatalError ( "Setup cancelled " ) ;
8688 }
8789
8890 if ( dryRun ) {
You can’t perform that action at this time.
0 commit comments