-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Escape filename in line blob URL (Fixes #10)
adds template testcase update dependencies
- Loading branch information
Julian Bildner
committed
Mar 19, 2022
1 parent
4588f48
commit 1abe13e
Showing
8 changed files
with
11,406 additions
and
8,944 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
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
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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module.exports = `This issue has been reopened because the **\`{{ keyword }}\`** comment still exists in [**{{ filename }}**](https://{{ githubHost }}/{{ owner }}/{{ repo }}/blob/{{ sha }}/{{ filename }}), as of {{ sha }}. | ||
module.exports = `This issue has been reopened because the **\`{{ keyword }}\`** comment still exists in [**{{ filename }}**](https://{{ githubHost }}/{{ owner }}/{{ repo }}/blob/{{ sha }}/{{ escapedFilename }}), as of {{ sha }}. | ||
--- | ||
###### If this was not intentional, just remove the comment from your code. You can also set the [\`reopenClosed\`](https://github.com/JasonEtco/todo#configuring-for-your-project) config if you don't want this to happen at all anymore.` | ||
###### If this was not intentional, just remove the comment from your code. You can also set the [\`reopenClosed\`](https://github.com/DerJuulsn/todo-issue#available-options) config if you don't want this to happen at all anymore.` |
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,37 @@ | ||
import {template} from "../src/templates"; | ||
import {Todo} from "../src/Todo"; | ||
|
||
describe("Check comment generation", () => { | ||
|
||
it("matches desired comment template - file with whitespace name", async () => { | ||
|
||
let filename = "some file.txt"; | ||
|
||
const body = template.issue( | ||
{ | ||
repo: "todo-issue", | ||
owner: "DerJuulsn", | ||
body: "Test Comment", | ||
...{ | ||
escapedFilename: encodeURI(filename), | ||
filename, | ||
keyword: "TODO", | ||
assignedToString: "@DerJuulsn", | ||
sha: "SHA", | ||
range: "L1", | ||
} as Todo | ||
}); | ||
|
||
expect(body).toEqual( | ||
"Test Comment\n" + | ||
"\n" + | ||
"---\n" + | ||
"\n" + | ||
"https://github.com/DerJuulsn/todo-issue/blob/SHA/some%20file.txt#L1\n" + | ||
"\n" + | ||
"---\n" + | ||
"\n" + | ||
"###### This issue was generated by [todo-issue](https://github.com/DerJuulsn/todo-issue) based on a `TODO` comment in SHA.@DerJuulsn"); | ||
}) | ||
|
||
}) |