-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from phntmxyz/develop
Add custom todo comment matcher
- Loading branch information
Showing
10 changed files
with
388 additions
and
82 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,30 @@ | ||
import { generateComment } from '../src/comment' | ||
|
||
describe('setting comment body and checkbox', () => { | ||
it('should be used correctly', () => { | ||
const commentBodyTemplate = `A new Todo was discovered. If it is not a priority right now, consider marking it for later attention.\n{todo}\n` | ||
const commentCheckboxTemplate = 'Ignore' | ||
|
||
const todo = { | ||
filename: 'included/other.txt', | ||
line: 22, | ||
content: 'TODO - in included directory', | ||
isAdded: true | ||
} | ||
|
||
const comment = generateComment( | ||
commentBodyTemplate, | ||
commentCheckboxTemplate, | ||
todo | ||
) | ||
|
||
const expectedComment = [ | ||
'A new Todo was discovered. If it is not a priority right now, consider marking it for later attention.', | ||
'TODO - in included directory', | ||
'', | ||
'- [ ] Ignore' | ||
].join('\n') | ||
|
||
expect(comment).toEqual(expectedComment) | ||
}) | ||
}) |
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
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
Oops, something went wrong.