-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
0c12660
commit b2615ad
Showing
35 changed files
with
106 additions
and
77 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"/design": "https://docs.google.com/document/d/1pGNLsDr-WysIIqB4nc1pTCL8FMmPxkJMNoGsRMkA0TY/edit", | ||
"/github": "https://github.com/EthanThatOneKid/fart/", | ||
"/author": "https://etok.codes/" | ||
"/github": "https://github.com/EthanThatOneKid/fart", | ||
"/author": "https://etok.codes" | ||
} |
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,4 +1,36 @@ | ||
import { assertEquals } from "../../../deps/std/testing.ts"; | ||
import { redirectIfShortlink } from "./shortlinks.ts"; | ||
import shortlinks from "./shortlinks.json" assert { type: "json" }; | ||
|
||
// TODO(@ethanthatonekid): write tests for shortlinks.ts | ||
Deno.test("shortlink redirects to GitHub repository", () => { | ||
const request = new Request("http://localhost:8080/github"); | ||
const response = redirectIfShortlink(request); | ||
assertEquals(response?.status, 302); | ||
assertEquals(response?.headers.get("location"), shortlinks["/github"] + "/"); | ||
}); | ||
|
||
Deno.test("shortlink redirects to GitHub repository and preserves path", () => { | ||
const request = new Request( | ||
"http://localhost:8080/github/milestone/1?closed=1", | ||
); | ||
const response = redirectIfShortlink(request); | ||
assertEquals(response?.status, 302); | ||
assertEquals( | ||
response?.headers.get("location"), | ||
shortlinks["/github"] + | ||
"/milestone/1?closed=1", | ||
); | ||
}); | ||
|
||
Object.entries(shortlinks) | ||
.forEach(([shortlink, destination]) => { | ||
// add a slash if the destination doesn't end with one | ||
if (!destination.endsWith("/")) destination += "/"; | ||
|
||
Deno.test(`shortlink ${shortlink} redirects to ${destination}`, () => { | ||
const request = new Request("http://localhost:8080" + shortlink); | ||
const response = redirectIfShortlink(request); | ||
assertEquals(response?.status, 302); | ||
assertEquals(response?.headers.get("location"), destination); | ||
}); | ||
}); |
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
5 changes: 3 additions & 2 deletions
5
.../bonus_features/versions/deno_redirect.ts → ...features/versions/deno_deploy_redirect.ts
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 +1 @@ | ||
export { redirectToDenoDeployPreviewUrl } from "./deno_redirect.ts"; | ||
export { redirectToDenoDeployPreviewUrl } from "./deno_deploy_redirect.ts"; |
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 was deleted.
Oops, something went wrong.
3 changes: 1 addition & 2 deletions
3
lib/cartridge/cartridge.test.ts → lib/transpile/cartridge/cartridge.test.ts
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
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
lib/code_block/code_block.test.ts → lib/transpile/code_block/code_block.test.ts
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
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
lib/indent/indent.test.ts → lib/transpile/indent/indent.test.ts
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
lib/text_builder/text_builder.test.ts → ...anspile/text_builder/text_builder.test.ts
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
lib/text_builder/utils.test.ts → lib/transpile/text_builder/utils.test.ts
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
lib/tokenize/lexicon.test.ts → lib/transpile/tokenize/lexicon.test.ts
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
lib/tokenize/token.test.ts → lib/transpile/tokenize/token.test.ts
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
lib/tokenize/tokenize.test.ts → lib/transpile/tokenize/tokenize.test.ts
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
lib/tokenize/utils.test.ts → lib/transpile/tokenize/utils.test.ts
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
File renamed without changes.
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
b2615ad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failed to deploy: