From 335879218e2dee057bd5bc7ecf33f8d3ebb4120e Mon Sep 17 00:00:00 2001 From: aswind7 <854413241@qq.com> Date: Tue, 23 Apr 2024 04:09:46 +0800 Subject: [PATCH] Update project-name.test.js (#10766) head and tail blank spaces should be trimed --- packages/create-astro/test/project-name.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/create-astro/test/project-name.test.js b/packages/create-astro/test/project-name.test.js index 74196a35ae81..8f14969e28cc 100644 --- a/packages/create-astro/test/project-name.test.js +++ b/packages/create-astro/test/project-name.test.js @@ -56,8 +56,8 @@ describe('project name', async () => { assert.equal(context.projectName, 'foobar'); }); - it('blank space', async () => { - const context = { projectName: '', cwd: '', prompt: () => ({ name: 'foobar' }) }; + it('head and tail blank spaces should be trimed', async () => { + const context = { projectName: '', cwd: '', prompt: () => ({ name: ' foobar ' }) }; await projectName(context); assert.equal(context.cwd, 'foobar'); assert.equal(context.projectName, 'foobar');