diff --git a/.npmignore b/.npmignore deleted file mode 100644 index e291b59..0000000 --- a/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -benchmark/ -test/ -cov/ -Makefile -covrage.html diff --git a/.travis.yml b/.travis.yml index 9adc565..d76269d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,5 +2,7 @@ language: node_js node_js: - "0.10" - "0.11" + - "0.12" + - "iojs-1" script: "make test-travis" after_script: "npm install coveralls@2.10.0 && cat ./coverage/lcov.info | coveralls" diff --git a/Makefile b/Makefile index afc23e3..3ca58dd 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ TESTS = test/*.test.js -REPORTER = tap +REPORTER = spec TIMEOUT = 3000 MOCHA_OPTS = install: - @npm install --registry=http://registry.npm.taobao.org + @npm install test: @NODE_ENV=test ./node_modules/mocha/bin/mocha \ diff --git a/README.md b/README.md index d1bd40d..20a2ca3 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ $ npm install humanize-ms ## Examples -``` +```js var ms = require('humanize-ms'); ms('1s') // 1000 diff --git a/index.js b/index.js index 097d3f4..c2423f1 100644 --- a/index.js +++ b/index.js @@ -15,6 +15,6 @@ var ms = require('ms'); module.exports = function (t) { if (typeof t === 'number') return t; var r = ms(t); - if (r === undefined) console.warn('ms(%s) got undefined in %s', t, __filename); + if (r === undefined) console.warn('ms(%j) got undefined in %s', t, __filename); return r; }; diff --git a/package.json b/package.json index 3724a29..8da5773 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "1.0.1", "description": "transform humanize time to ms", "main": "index.js", + "files": ["index.js"], "scripts": { "test": "make test" }, @@ -21,12 +22,12 @@ }, "license": "MIT", "dependencies": { - "ms": "~0.6.2" + "ms": "~0.7.0" }, "devDependencies": { - "autod": "~0.3.2", - "istanbul": "~0.3.0", - "mocha": "~1.21.4", - "should": "~4.0.4" + "autod": "*", + "istanbul": "*", + "mocha": "*", + "should": "*" } } diff --git a/test/index.test.js b/test/index.test.js index 4e97966..d050f40 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -22,6 +22,8 @@ describe('humanize-ms', function () { describe('when string', function () { it('should transform to number', function () { ms('1s').should.equal(1000); + ms('1m').should.equal(60000); + ms('1').should.equal(1); }); });