-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
import * as t from "tap"; | ||
import { | ||
extractFromContext, | ||
extractFromQuery, | ||
extractFromHeaders, | ||
extractFromCookies, | ||
extractFromBody, | ||
} from "./extractFromContext"; | ||
import { extract } from "./extractFromContext"; | ||
|
||
t.test("Can extract() extract Query objects", async () => { | ||
t.same(extract({ age: { $gt: "21" } }), ["age", "$gt", "21"]); | ||
t.same(extract({ title: { $ne: "null" } }), ["title", "$ne", "null"]); | ||
t.same(extract({ age: "whaat", user_input: ["whaat", "dangerous"]}), ["user_input", "age", "whaat", "dangerous"]) | ||
Check failure on line 7 in library/src/sinks/extractFromContext.test.ts GitHub Actions / build (16.x)
Check failure on line 7 in library/src/sinks/extractFromContext.test.ts GitHub Actions / build (20.x)
|
||
}); | ||
|
||
t.test("Can extract() extract cookie objects", async () => { | ||
t.same(extract({session: "ABC", session2: "DEF"}), ["session2", "session", "ABC", "DEF"]) | ||
Check failure on line 11 in library/src/sinks/extractFromContext.test.ts GitHub Actions / build (16.x)
Check failure on line 11 in library/src/sinks/extractFromContext.test.ts GitHub Actions / build (20.x)
Check failure on line 11 in library/src/sinks/extractFromContext.test.ts GitHub Actions / build (18.x)
|
||
}) | ||
Check failure on line 12 in library/src/sinks/extractFromContext.test.ts GitHub Actions / build (16.x)
Check failure on line 12 in library/src/sinks/extractFromContext.test.ts GitHub Actions / build (20.x)
|