From 7522afc9c862b5b4ab47681298f91422286a8943 Mon Sep 17 00:00:00 2001 From: Emilio Date: Tue, 29 Aug 2017 12:44:38 -0300 Subject: [PATCH] agregamos pruebas para datetime --- package.json | 8 ++++---- test/test.js | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 480b5d4..5a1dcd4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "json4all", "description": "JSON for all purposes and all environments", - "version": "0.3.6", + "version": "0.3.7", "author": "Codenautas ", "repository": "codenautas/json4all", "license": "MIT", @@ -33,10 +33,10 @@ "mocha": "~3.5.0", "phantomjs-prebuilt": "~2.1.15", - "best-globals": "~0.10.0", - "discrepances": "~0.1.4", + "best-globals": "~0.10.1", + "discrepances": "~0.2.1", "require-bro": "~0.1.5", - "type-store": "~0.1.12" + "type-store": "~0.2.0" }, "engines": { "node": ">= 0.12" diff --git a/test/test.js b/test/test.js index 8a36e47..211a882 100644 --- a/test/test.js +++ b/test/test.js @@ -8,6 +8,7 @@ var ExampleClass = ExampleClass = require('./example-class.js'); var bestGlobals = require('best-globals'); var date = bestGlobals.date; +var datetime = bestGlobals.datetime; var deepEqual; @@ -98,6 +99,8 @@ var fixtures=[ {name:'{fecha}' ,value: {a:1, f:new Date(2016,2,2)} , check:function(o){ return o.f instanceof Date; }}, {bg:true, name:'fech',value: date.iso("1999-12-31") , expectEncode: '{"$special":"date","$value":"1999-12-31"}', check:function(o){ return o instanceof Date && o.isRealDate; }}, {bg:true, name:'{fech}',value: {a:1, f:date.ymd(2016,2,2)}, check:function(o){ return o.f.isRealDate; }}, + {bg:true, name:'datetime',value: datetime.iso("1999-12-31") , expectEncode: '{"$special":"Datetime","$value":"1999-12-31"}', check:function(o){ return o instanceof bestGlobals.Datetime; }}, + {bg:true, name:'{datetime}',value: {a:1, f:datetime.ymdHms(2016,2,2,12,1,2)}, check:function(o){ return o.f instanceof bestGlobals.Datetime; }}, {name:'bigNumber' ,value: 12345678901234567890 }, {name:'bool' ,value: true }, {name:'null' ,value: null },