Skip to content

Commit

Permalink
[test] follow npm recommendations
Browse files Browse the repository at this point in the history
  • Loading branch information
julianduque committed Mar 14, 2013
1 parent e9765aa commit 4b8ca0c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/jitsu/package.js
Expand Up @@ -541,7 +541,7 @@ package.properties = function (dir) {
name: 'name',
unique: true,
message: 'App name',
validator: /^[\w|\-|\.]+$/,
validator: /^[A-Za-z0-9][\w|\-|\.]+$/,
default: path.basename(dir)
},
{
Expand Down
9 changes: 8 additions & 1 deletion test/lib/package-test.js
Expand Up @@ -51,7 +51,14 @@ var suite = vows.describe('jitsu/package').addBatch({
topic: setupPackage({ name: '.example-app' }),

'should be invalid': function (topic) {
assert.ok(isValid('name', topic.name));
assert.ok(!isValid('name', topic.name));
}
},
'starting with _': {
topic: setupPackage({ name: '_example-app' }),

'should be invalid': function (topic) {
assert.ok(!isValid('name', topic.name));
}
},
'containing -': {
Expand Down

0 comments on commit 4b8ca0c

Please sign in to comment.