From 22a7a85d5052601e97b853c407c8aea28f44fbfd Mon Sep 17 00:00:00 2001 From: Jun Yang Date: Mon, 1 Oct 2018 23:00:49 +0800 Subject: [PATCH] test case for Regexp rendering --- test/unit/util/underscore.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/unit/util/underscore.js b/test/unit/util/underscore.js index 2a006234d..a9203a499 100644 --- a/test/unit/util/underscore.js +++ b/test/unit/util/underscore.js @@ -51,6 +51,10 @@ describe('util/underscore', function () { it('should return "undefined" for undefined', function () { expect(_.stringify(undefined)).to.equal('undefined') }) + it('should return regex string for RegExp', function () { + const reg = /foo/g + expect(_.stringify(reg)).to.equal('/foo/g') + }) it('should return locale string for date', function () { const date = new Date('2018-10-01T14:51:00.000Z') // Mon Oct 01 2018 22:51:00 GMT+0800 (CST)