From 2e65b5e2d117ac5299ffc58201ff5da2bd73509f Mon Sep 17 00:00:00 2001 From: harttle Date: Thu, 16 Jun 2016 01:25:44 +0800 Subject: [PATCH] global locale test for date filter --- test/filters.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/filters.js b/test/filters.js index a4fb0231d..7bdf9d901 100644 --- a/test/filters.js +++ b/test/filters.js @@ -5,7 +5,6 @@ var liquid = require('..')(); describe('filters', function() { var ctx = { - date: new Date('1995-12-17T03:24:00'), foo: 'bar', arr: [-2, 'a'] }; @@ -32,8 +31,9 @@ describe('filters', function() { }); it('should support date', function() { - expect(liquid.render('{{ date | date:"%Y-%m-%d %H:%M:%S"}}', ctx)).to.equal('1995-12-17 11:24:00'); - expect(liquid.render('{{ date | date:"%a, %b %d, %y"}}', ctx)).to.equal('Sun, Dec 17, 95'); + var d = ctx.date = new Date(); + str = d.toDateString(); + expect(liquid.render('{{ date | date:"%a %b %d %Y"}}', ctx)).to.equal(str); }); it('should support default', function() {