From df76f984a32898fd3ee5c652f37be34b273d96c6 Mon Sep 17 00:00:00 2001 From: Estevao Soares dos Santos Date: Thu, 10 Mar 2022 12:56:34 +0000 Subject: [PATCH] chore: add test for repeat helper Several test cleanups and minor test fixes --- Gruntfile.js | 10 ++++------ dist/showdown.js | Bin 207878 -> 209123 bytes dist/showdown.js.map | Bin 596148 -> 600068 bytes dist/showdown.min.js | Bin 97849 -> 98369 bytes dist/showdown.min.js.map | Bin 108383 -> 108977 bytes src/helpers.js | 14 +++++++++----- test/unit/showdown.Converter.makeHtml.js | 9 ++++----- test/unit/showdown.Converter.makeMarkdown.js | 11 +++++------ test/unit/showdown.helpers.js | 16 ++++++++++++++-- test/unit/showdown.js | 1 + 10 files changed, 37 insertions(+), 24 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index b451a2d..5d0cc45 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -144,7 +144,6 @@ module.exports = function (grunt) { } }, single: { - src: 'test/node/**/*.js', options: { globals: ['should'], timeout: 3000, @@ -153,7 +152,7 @@ module.exports = function (grunt) { } }, cli: { - src: 'test/node/testsuite.cli.js', + src: 'test/unit/cli.js', options: { globals: ['should'], timeout: 3000, @@ -208,14 +207,12 @@ module.exports = function (grunt) { /** * Run a single test */ - grunt.registerTask('single-test', function (grep) { + grunt.registerTask('single-test', function (file) { 'use strict'; grunt.config.merge({ simplemocha: { single: { - options: { - grep: grep - } + src: file } } }); @@ -230,6 +227,7 @@ module.exports = function (grunt) { grunt.registerTask('test-functional', ['concat:test', 'simplemocha:functional', 'clean']); grunt.registerTask('test-unit', ['concat:test', 'simplemocha:unit', 'clean']); grunt.registerTask('test-cli', ['clean', 'lint', 'concat:test', 'simplemocha:cli', 'clean']); + grunt.registerTask('performance', ['concat:test', 'performancejs', 'clean']); grunt.registerTask('build', ['test', 'concat:dist', 'concat:cli', 'uglify:dist', 'uglify:cli', 'endline']); grunt.registerTask('build-without-test', ['concat:dist', 'uglify', 'endline']); diff --git a/dist/showdown.js b/dist/showdown.js index 13ef5291888f232c3321cfb599fbe520fc93fa0f..347181b591011ea7796d61ce605f041e8413f5ec 100644 GIT binary patch delta 1141 zcmah}O>5LZ7-kDS7>X;{lOVnaCE0EFqg7DsMyj%)2QL=!>g?_$8JWz4`Pg-}C5WIu zAO|lV{0V}Bc=iYA(QEM!2>t=z$tG^8Ed~Nf=FRgyAMecTA8S7k*FJoTF2kNtOvK$x zNh8fXqg_QaN(^L@&m+dU2kqkh?t1ai=P`n#>`6+Z-EqLJpUWyv4 z1Yn|5f|>dM@K1o}RBJE^5x_*0mnh3F3nn2vASUTX zTq4V*UPr+h!KsK%0**%?_V*Y5FJ5atm2JLX`_${fP-yG2uj(1b0r}Of&WIVLVrWbi z5YFXHgGGiC5=y3w&p~E}rR+IH))Wm!sFYx~8BwMScdP*-<})(igjAw~W2+Pu27=o* zc8+fMx30Bdg#K%)G>nPx4WRr9N3g)5p(doIVG9NW*uDYdgkYgmz$Ipd1E%H8;z@id zKW0F?QgSP-f34-87WeTugft+hRH4%|6!nayHm&G@M#aludhMsWh~u+GGdYt_iE`C< z-Oj-2JCaF7$+><)lx3=1##N@!TjcD%Y`4lunLx$E2M)X^^2 zyV{NxW(Ivsqh{DS!m#YJ+*CW>!H(zk+HKtS{~iq)nGD6`=+WTHc0YcJuCKiP{k?I% ai6=*ZReNQEoA9c^-ZWU_bAzp{e*FX7*>@TM delta 49 zcmaF-kf-ei&xS2&lXr)6Z|=@EWD+b$ObIS2%FIjGD@rX$O)Sx9zL(p6FPCxqy<8^N F!vHHQ6_Nk| diff --git a/dist/showdown.js.map b/dist/showdown.js.map index 1a0100fbc385345a04572dd1de16d6a8454069b2..d0b8c3b321d7a36f0fb4aa9546bc454f49e4f747 100644 GIT binary patch delta 2176 zcmb7EZ)_7~9M10EEA7E(g&VLb@EeSD?f$eIniyc(3Uv-*GC_?HBD<}(_V9Yw-Cb8U zwyX*2{6xxL$NP;GQ2ZiNBV;W8$&5=df^lkCq9F#qX)?p&2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v z6(wL5QSsBUi%8|nQq;(^??vX8@O_#AL{YIGysK$ zSjAeSZjAC5t@zT8g@B6-SR1EVFnan|CiEG88kL?kZ;CTd(vgl8K;rHvDb#lR-6yGk zzyt8iAKi1l~&UF zn6<^e6*r(i%ye1v65~W2EMzHG5^kMeN63Qs)>E{1sji@g@pC?4$TY=`m+2hD=WT;*-dn+KnhiG~ZsUcy0a6`+G{nr)l<8of z%lylV?>$Y!$C@xJOiBJ6zY?D>$xoaoc}j}=i{zLHK0`Nl6~SJ<#UK1K!D3p(o}qm^ zIY#7tmO$~}a0waPKYE4=zM_)FcENHe%;M}oq5Vk?QE^;6iT{|Lcl{jHi_vjm z9tKp1KM>NfoI?t5a@182k3UQIUYo@%5HFEVd)2BLHoo{)#Gw=;YvzRY936rhPd>8upq8}o>CpGDQu=nV)}XdYDTN|WEoJHX)HK6%xOJlPY8}AI2FaO zPRy#cCea_q2Cu3xkw3O0<9}^t5#7$dK)oIOwv=S?;0v6$z?cDy2mOdIzkp8Ts(9@M z9GNVLf56>RQQOUV&?7)yj?55@xk5L z*fxCdgUF}}Kgb|BEMTjlPy9TRX$6aG@cb?>2^7$>f_F+Q3$v|3z$dPJk-9os#LSC> gFH*3p2yD@PiJ$Y~lf-lLV){kwa7EnzB3=7`0G}74S^xk5 diff --git a/src/helpers.js b/src/helpers.js index 6ca54bf..ac5f1c7 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -363,12 +363,16 @@ showdown.helper.encodeEmailAddress = function (mail) { /** * String.prototype.repeat polyfill * - * @param str - * @param count + * @param {string} str + * @param {int} count * @returns {string} */ -function repeat (str, count) { +showdown.helper.repeat = function (str, count) { 'use strict'; + // use built-in method if it's available + if (!showdown.helper.isUndefined(String.prototype.repeat)) { + return str.repeat(count); + } str = '' + str; if (count < 0) { throw new RangeError('repeat count must be non-negative'); @@ -396,7 +400,7 @@ function repeat (str, count) { } str += str.substring(0, maxCount - str.length); return str; -} +}; /** * String.prototype.padEnd polyfill @@ -418,7 +422,7 @@ showdown.helper.padEnd = function padEnd (str, targetLength, padString) { } else { targetLength = targetLength - str.length; if (targetLength > padString.length) { - padString += repeat(padString, targetLength / padString.length); //append to original to ensure we are longer than needed + padString += showdown.helper.repeat(padString, targetLength / padString.length); //append to original to ensure we are longer than needed } return String(str) + padString.slice(0,targetLength); } diff --git a/test/unit/showdown.Converter.makeHtml.js b/test/unit/showdown.Converter.makeHtml.js index 9f1591e..26a9f59 100644 --- a/test/unit/showdown.Converter.makeHtml.js +++ b/test/unit/showdown.Converter.makeHtml.js @@ -1,15 +1,14 @@ /** * Created by Estevao on 15-01-2015. */ +require('source-map-support').install(); +require('chai').should(); +require('sinon'); +var showdown = require('../../.build/showdown.js'); describe('showdown.Converter', function () { 'use strict'; - require('source-map-support').install(); - require('chai').should(); - - var showdown = require('../../.build/showdown.js'); - describe('Converter.options extensions', function () { var runCount; showdown.extension('testext', function () { diff --git a/test/unit/showdown.Converter.makeMarkdown.js b/test/unit/showdown.Converter.makeMarkdown.js index fb85bf2..95e6e9c 100644 --- a/test/unit/showdown.Converter.makeMarkdown.js +++ b/test/unit/showdown.Converter.makeMarkdown.js @@ -1,15 +1,14 @@ /** * Created by Estevao on 15-01-2015. */ +require('source-map-support').install(); +require('chai').should(); +require('sinon'); +var showdown = require('../../.build/showdown.js'); describe('showdown.Converter', function () { 'use strict'; - require('source-map-support').install(); - require('chai').should(); - var jsdom = require('jsdom'), - document = new jsdom.JSDOM('', {}).window.document, // jshint ignore:line - showdown = require('../../.build/showdown.js'); describe('makeMarkdown()', function () { var converter = new showdown.Converter(); @@ -18,7 +17,7 @@ describe('showdown.Converter', function () { var html = 'a link\n'; var md = '[a link]()'; - converter.makeMarkdown(html, document).should.equal(md); + converter.makeMarkdown(html).should.equal(md); }); }); diff --git a/test/unit/showdown.helpers.js b/test/unit/showdown.helpers.js index c9e35c8..2995728 100644 --- a/test/unit/showdown.helpers.js +++ b/test/unit/showdown.helpers.js @@ -1,11 +1,14 @@ /** - * Created by Estevao on 27/01/2017. + * Created by Tivie on 27/01/2017. */ +require('source-map-support').install(); +require('chai').should(); +require('sinon'); +var showdown = require('../../.build/showdown.js'); /*jshint expr: true*/ /*jshint -W053 */ /*jshint -W010 */ /*jshint -W009 */ -var showdown = require('../../.build/showdown.js'); describe('encodeEmailAddress()', function () { 'use strict'; @@ -245,3 +248,12 @@ describe('matchRecursiveRegExp()', function () { }); +describe('repeat()', function () { + 'use strict'; + it('work produce the same output as String.prototype.repeat()', function () { + var str = 'foo', + expected = str.repeat(100), + actual = showdown.helper.repeat(str, 100); + expected.should.equal(actual); + }); +}); diff --git a/test/unit/showdown.js b/test/unit/showdown.js index 64465d0..0d9cbf4 100644 --- a/test/unit/showdown.js +++ b/test/unit/showdown.js @@ -1,5 +1,6 @@ require('source-map-support').install(); require('chai').should(); +require('sinon'); var expect = require('chai').expect, showdown = require('../../.build/showdown.js');