diff --git a/src/utils/project-configuration-validator.js b/src/utils/project-configuration-validator.js index bc35a5c..6a31bc1 100644 --- a/src/utils/project-configuration-validator.js +++ b/src/utils/project-configuration-validator.js @@ -12,9 +12,8 @@ export function validateProjectName(value) { // a project name is a project name for which the folder does not exist, // for which the name is no blank/undefined or contains spaces - // TODO: this validation allows for project names with /, which would not create a valid directory if (typeof value === 'undefined' || value === '' - || value.indexOf(' ') !== -1 || !isValidPath(value)) { + || value.indexOf(' ') !== -1 || !isValidPath(value) || value.indexOf('/') > -1) { return 'Invalid project name!'; } diff --git a/test/project-configuration-validator.test.js b/test/project-configuration-validator.test.js index 4b89a95..b318e2e 100644 --- a/test/project-configuration-validator.test.js +++ b/test/project-configuration-validator.test.js @@ -118,8 +118,7 @@ describe('Project Configuration Validator', () => { assert.equal(validateProjectName('**baddname'), 'Invalid project name!'); assert.equal(validateProjectName(), 'Invalid project name!'); assert.equal(validateProjectName('thisisaverylongnamethatisovertwentycharacterslong'), 'Project Names must be less than 20 characters or less!'); - //TODO add validation for / when it gets fixed - //assert.equal(validateProjectName("jack/"), 'Invalid project name!') + assert.equal(validateProjectName("test1/"), 'Invalid project name!') }); });