-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
27 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* `wrap-ansi` is an ES Module, and `jest` does not fully support it. | ||
* | ||
* Related Jest Issue: | ||
* title: Meta: Native support for ES Modules #9430 | ||
* url: https://github.com/jestjs/jest/issues/9430 | ||
**/ | ||
jest.mock('wrap-ansi', () => (str: string) => str); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { diffLines } from '../../src/utils'; | ||
|
||
describe('String Utils', () => { | ||
it('should return `undefined` if there is no diff line', () => { | ||
const input = 'Lorem Ipsum is simply dummy text\n of the printing \nand typesetting industry.'; | ||
|
||
expect(diffLines(input, input)).toBeUndefined(); | ||
}); | ||
|
||
it('should return a list with the index of each diff line', () => { | ||
const inputA = | ||
'Lorem Ipsum is simply dummy\n text\n of the \nprinting\n \nand typesetting industry.'; | ||
const inputB = | ||
'Lorem Ipsum is simply dummy\n \ntext of the \nprinting\n and\n typesetting industry.'; | ||
|
||
expect(diffLines(inputA, inputB)).toStrictEqual([1, 2, 4, 5]); | ||
}); | ||
}); |