Skip to content

Commit

Permalink
update changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
aswind7 committed Sep 6, 2023
1 parent dfadc6b commit a6a7299
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/eighty-gifts-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-astro': patch
---

trim project name of the user input
9 changes: 9 additions & 0 deletions packages/create-astro/test/project-name.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ describe('project name', () => {
expect(context.projectName).to.eq('foobar');
});


it('blank space', async () => {
const context = { projectName: '', cwd: '', prompt: () => ({ name: 'foobar ' }) };
await projectName(context);

expect(context.cwd).to.eq('foobar');
expect(context.projectName).to.eq('foobar');
});

it('normalize', async () => {
const context = { projectName: '', cwd: '', prompt: () => ({ name: 'Invalid Name' }) };
await projectName(context);
Expand Down

0 comments on commit a6a7299

Please sign in to comment.