From aa1f3bedb91f13509404abc621d1c58d1d3d314f Mon Sep 17 00:00:00 2001 From: miya0001 Date: Sat, 22 Jul 2017 00:11:37 +0900 Subject: [PATCH] fixed #11 --- .travis.yml | 2 +- package.json | 3 ++- test/test-csv.js | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 test/test-csv.js diff --git a/.travis.yml b/.travis.yml index 36f44df..710e50d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ branches: - master before_script: npm install script: -- ls -al + - npm test after_success: - npm run deploy - bash ./bin/deploy.sh diff --git a/package.json b/package.json index adec574..7e38bbf 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/test/test-csv.js b/test/test-csv.js new file mode 100644 index 0000000..f096e06 --- /dev/null +++ b/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