Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

tests for ms()

  • Loading branch information...
commit dd8f79a3f49e587fd1528802589cb79c3a595695 1 parent d2d3a23
@tj authored
Showing with 20 additions and 1 deletion.
  1. +2 −1  Makefile
  2. +18 −0 test/ms.js
View
3  Makefile
@@ -1,6 +1,7 @@
test:
@./node_modules/.bin/mocha \
- --require should
+ --require should \
+ --reporter spec
.PHONY: test
View
18 test/ms.js
@@ -0,0 +1,18 @@
+
+var Parser = require('../')
+ , ms = Parser.ms;
+
+describe('ms', function(){
+ it('should parse string ms representations', function(){
+ ms('', '1000ms').should.equal(1000);
+ ms('', '1s').should.equal(1000);
+ ms('', '4 seconds').should.equal(4000);
+ ms('', '4 seconds').should.equal(4000);
+ ms('', '2 minutes').should.equal(2 * 60000);
+ ms('', '1 hour').should.equal(3600000);
+ ms('', '2 days').should.equal(2 * 86400000);
+ ms('', '5y').should.equal(5 * 31557600000);
+ ms('', '1 year').should.equal(31557600000);
+ ms('', '5 years').should.equal(5 * 31557600000);
+ })
+})
Please sign in to comment.
Something went wrong with that request. Please try again.