fix: default length for truncate and truncatewords

This commit is contained in:
harttle
2019-02-23 03:11:07 +08:00
parent 5b6100d12b
commit 56c7992b76
11 changed files with 91 additions and 34 deletions
+4
View File
@@ -52,6 +52,10 @@ describe('util/underscore', function () {
it('should return "" for undefined', function () {
expect(_.stringify(undefined)).to.equal('')
})
it('should use Object.prototype.toString if no toString method exists', function () {
const obj = { toString: undefined }
expect(_.stringify(obj)).to.equal('[object Object]')
})
it('should return regex string for RegExp', function () {
const reg = /foo/g
expect(_.stringify(reg)).to.equal('/foo/g')