File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,16 @@ import {expect} from 'chai';
6
6
describe ( 'diff/character' , function ( ) {
7
7
describe ( '#diffChars' , function ( ) {
8
8
it ( 'Should diff chars' , function ( ) {
9
- const diffResult = diffChars ( 'New Value.' , 'New ValueMoreData.' ) ;
10
- expect ( convertChangesToXML ( diffResult ) ) . to . equal ( 'New Value<ins>MoreData</ins>.' ) ;
9
+ const diffResult = diffChars ( 'Old Value.' , 'New ValueMoreData.' ) ;
10
+ expect ( convertChangesToXML ( diffResult ) ) . to . equal ( '<del>Old</del><ins>New</ins> Value<ins>MoreData</ins>.' ) ;
11
+ } ) ;
12
+
13
+ describe ( 'oneChangePerToken option' , function ( ) {
14
+ it ( 'emits one change per token' , function ( ) {
15
+ const diffResult = diffChars ( 'Old Value.' , 'New ValueMoreData.' , { oneChangePerToken : true } ) ;
16
+ expect ( diffResult . length ) . to . equal ( 21 ) ;
17
+ expect ( convertChangesToXML ( diffResult ) ) . to . equal ( '<del>O</del><del>l</del><del>d</del><ins>N</ins><ins>e</ins><ins>w</ins> Value<ins>M</ins><ins>o</ins><ins>r</ins><ins>e</ins><ins>D</ins><ins>a</ins><ins>t</ins><ins>a</ins>.' ) ;
18
+ } ) ;
11
19
} ) ;
12
20
13
21
describe ( 'case insensitivity' , function ( ) {
You can’t perform that action at this time.
0 commit comments