Skip to content

Commit

Permalink
add extra info to http result
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed May 28, 2024
1 parent 808a0b6 commit a088bfa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 25 deletions.
32 changes: 8 additions & 24 deletions examples/outgoing_http_requests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/outgoing_http_requests/test/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function checkXkcdResult(result: HttpResponse | string): AzleResult<string> {
? JSON.parse(result)
: JSON.parse(decodeUtf8(Uint8Array.from(result.body)));
const expectedJson = JSON.parse(
`{"month": "9", "num": 642, "link": "", "year": "2009", "news": "", "safe_title": "Creepy", "alt": "And I even got out my adorable new netbook!", "img": "https://imgs.xkcd.com/comics/creepy.png", "title": "Creepy", "day": "28"}`
`{"month": "9", "num": 642, "link": "", "year": "2009", "news": "", "safe_title": "Creepy", "alt": "And I even got out my adorable new netbook!", "img": "https://imgs.xkcd.com/comics/creepy.png", "title": "Creepy", "day": "28", "transcript":"[[Two people are sitting on chairs.]]\\nMan: Hey, cute netbook.\\nWoman: \\nWhat.\\n\\n\\nMan: Your laptop. I just --\\nWoman: No, why are you talking to me.\\n\\nWoman: Who do you think you are? If I were even slightly interested, I'd have shown it.\\n\\nWoman: Hey everyone, this dude's hitting on me.\\nVoice #1: Haha\\nVoice #2: Creepy\\nVoice #3: Let's get his picture for Facebook to warn others.\\n\\n((This panel fades into a thought bubble of the actual man.))\\n[[The girl is typing on her laptop.]]\\nDear blog,\\nCute boy on train still ignoring me.\\n\\n{{Title text: And I even got out my adorable new netbook!}}"}`
);

return testEquality(resultJson, expectedJson);
Expand Down

0 comments on commit a088bfa

Please sign in to comment.