-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(connect)!: set legacyGet header to false on cache.get and data.get
- Loading branch information
1 parent
ad3b64c
commit b9c5bc0
Showing
7 changed files
with
65 additions
and
32 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
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.
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,39 @@ | ||
// deno-lint-ignore-file ban-ts-comment | ||
import { assertEquals } from "../dev_deps.ts"; | ||
import { connect } from "../mod.ts"; | ||
|
||
const test = Deno.test; | ||
|
||
test("mod", async (t) => { | ||
await t.step("not found", async () => { | ||
globalThis.fetch = () => | ||
Promise.resolve( | ||
new Response(JSON.stringify({ ok: false }), { | ||
status: 404, | ||
headers: { "content-type": "application/json" }, | ||
}) | ||
); | ||
|
||
const hyper = connect("http://localhost:6363/test"); | ||
const result = await hyper.data.get("test-1"); | ||
assertEquals(result.ok, false); | ||
// @ts-ignore | ||
assertEquals(result.status, 404); | ||
}); | ||
|
||
await t.step("found", async () => { | ||
globalThis.fetch = () => | ||
Promise.resolve( | ||
new Response(JSON.stringify({ ok: true, doc: { _id: "test-1" } }), { | ||
status: 404, | ||
headers: { "content-type": "application/json" }, | ||
}) | ||
); | ||
|
||
const hyper = connect("http://localhost:6363/test"); | ||
const result = await hyper.data.get("test-1"); | ||
assertEquals(result.ok, true); | ||
// @ts-ignore | ||
assertEquals(result.doc, { _id: "test-1" }); | ||
}); | ||
}); |
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