File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ const marked = require('../../');
2
2
const HtmlDiffer = require ( '@markedjs/html-differ' ) . HtmlDiffer ;
3
3
const htmlDiffer = new HtmlDiffer ( { ignoreSelfClosingSlash : true } ) ;
4
4
5
+ const EXCERPT_LENGTH = 30 ;
6
+
5
7
beforeEach ( ( ) => {
6
8
marked . setOptions ( marked . getDefaults ( ) ) ;
7
9
@@ -22,12 +24,12 @@ beforeEach(() => {
22
24
for ( var i = 0 ; i < expectedHtml . length ; i ++ ) {
23
25
if ( actualHtml [ i ] !== expectedHtml [ i ] ) {
24
26
actualHtml = actualHtml . substring (
25
- Math . max ( i - 30 , 0 ) ,
26
- Math . min ( i + 30 , actualHtml . length ) ) ;
27
+ Math . max ( i - EXCERPT_LENGTH , 0 ) ,
28
+ Math . min ( i + EXCERPT_LENGTH , actualHtml . length ) ) ;
27
29
28
30
expectedHtml = expectedHtml . substring (
29
- Math . max ( i - 30 , 0 ) ,
30
- Math . min ( i + 30 , expectedHtml . length ) ) ;
31
+ Math . max ( i - EXCERPT_LENGTH , 0 ) ,
32
+ Math . min ( i + EXCERPT_LENGTH , expectedHtml . length ) ) ;
31
33
32
34
break ;
33
35
}
You can’t perform that action at this time.
0 commit comments