0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-02-17 22:44:24 -05:00

Update project-name.test.js (#10766)

head and tail blank spaces should be trimed
This commit is contained in:
aswind7 2024-04-23 04:09:46 +08:00 committed by GitHub
parent 5cb7d2aed8
commit 335879218e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -56,8 +56,8 @@ describe('project name', async () => {
assert.equal(context.projectName, 'foobar'); assert.equal(context.projectName, 'foobar');
}); });
it('blank space', async () => { it('head and tail blank spaces should be trimed', async () => {
const context = { projectName: '', cwd: '', prompt: () => ({ name: 'foobar' }) }; const context = { projectName: '', cwd: '', prompt: () => ({ name: ' foobar ' }) };
await projectName(context); await projectName(context);
assert.equal(context.cwd, 'foobar'); assert.equal(context.cwd, 'foobar');
assert.equal(context.projectName, 'foobar'); assert.equal(context.projectName, 'foobar');