You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"The project name you entered doesn't meet the requirements. It must be 3–32 characters long and use only letters, numbers, hyphens (-), underscores (_), and periods (.)",
expect(options[2]).toMatchObject({label: 'Create a new project',value: 'create'});
482
+
483
+
returnnewPromise((resolve)=>resolve('create'));
484
+
})
485
+
.mockImplementationOnce(async(message)=>{
486
+
expect(message).toBe('Enter a name for the new project:');
487
+
488
+
returnnewPromise((resolve)=>resolve('bad name'));
489
+
});
490
+
491
+
awaitexpect(
492
+
program.parseAsync([
493
+
'node',
494
+
'catalyst',
495
+
'project',
496
+
'link',
497
+
'--store-hash',
498
+
storeHash,
499
+
'--access-token',
500
+
accessToken,
501
+
]),
502
+
).rejects.toThrow(
503
+
"The project name you entered doesn't meet the requirements. It must be 3–32 characters long and use only letters, numbers, hyphens (-), underscores (_), and periods (.)",
Copy file name to clipboardExpand all lines: packages/catalyst/src/cli/lib/project.ts
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -95,6 +95,12 @@ export async function createProject(
95
95
);
96
96
}
97
97
98
+
if(response.status===422){
99
+
thrownewError(
100
+
"The project name you entered doesn't meet the requirements. It must be 3–32 characters long and use only letters, numbers, hyphens (-), underscores (_), and periods (.)",
101
+
);
102
+
}
103
+
98
104
if(!response.ok){
99
105
thrownewError(`Failed to create project: ${response.statusText}`);
0 commit comments