Permalink
Browse files

[test] follow npm recommendations

  • Loading branch information...
1 parent e9765aa commit 4b8ca0c462ea1d2670b7573e7a928eaafa9d72ad @julianduque julianduque committed Mar 14, 2013
Showing with 9 additions and 2 deletions.
  1. +1 −1 lib/jitsu/package.js
  2. +8 −1 test/lib/package-test.js
@@ -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)
},
{
@@ -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 -': {

0 comments on commit 4b8ca0c

Please sign in to comment.