Skip to content

Commit

Permalink
fixed #11
Browse files Browse the repository at this point in the history
  • Loading branch information
miya0001 committed Jul 21, 2017
1 parent f691226 commit aa1f3be
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -6,7 +6,7 @@ branches:
- master
before_script: npm install
script:
- ls -al
- npm test
after_success:
- npm run deploy
- bash ./bin/deploy.sh
Expand Down
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -5,7 +5,8 @@
"main": "dojopaas.js",
"scripts": {
"deploy": "node dojopaas.js",
"test": "node test/test.js"
"test": "node test/test.js",
"test:csv": "node test/test-csv.js"
},
"author": "",
"license": "MIT",
Expand Down
15 changes: 15 additions & 0 deletions test/test-csv.js
@@ -0,0 +1,15 @@
const fs = require('fs');
const csv = require('comma-separated-values');
const assert = require('assert');

fs.readFile('./servers.csv', 'utf8', function (err, text) {
var result = new csv(text, { header: true }).parse();
for (var i=0; i<result.length; i++) {
assert.deepEqual(true, !! result[i].name);
assert.deepEqual(true, !! result[i].branch);
assert.deepEqual(true, !! result[i].description);
assert.deepEqual(true, !! result[i].pubkey);
assert.deepEqual(true, !! result[i].name.match(/^[a-z0-9\-]+$/));
assert.deepEqual(true, !! result[i].branch.match(/^[a-z0-9\-]+$/));
}
})

0 comments on commit aa1f3be

Please sign in to comment.