summaryrefslogtreecommitdiff
path: root/cli/tests/unit_node/querystring_test.ts
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2024-01-02 10:24:11 +0530
committerGitHub <noreply@github.com>2024-01-02 04:54:11 +0000
commit642c4a44a56ed02c2bf795bf04d7aebbc847e150 (patch)
tree931139c9865eb2ee8b1f08f9351eae2abd3e5d7a /cli/tests/unit_node/querystring_test.ts
parentb21462355a61d69bedf15ae51304719f6014b8df (diff)
fix(ext/node): querystring stringify without encode callback (#21740)
Fixes https://github.com/denoland/deno/issues/21734 Changes: - Use default encode when options do not provide a encode callback. - Remove internal TS for `node:querystring`. Its not helping catching bugs like this because of invalid type assumptions and use of `any`, more of a maintenance burden.
Diffstat (limited to 'cli/tests/unit_node/querystring_test.ts')
-rw-r--r--cli/tests/unit_node/querystring_test.ts21
1 files changed, 21 insertions, 0 deletions
diff --git a/cli/tests/unit_node/querystring_test.ts b/cli/tests/unit_node/querystring_test.ts
index d750bed95..ce2747db2 100644
--- a/cli/tests/unit_node/querystring_test.ts
+++ b/cli/tests/unit_node/querystring_test.ts
@@ -28,3 +28,24 @@ Deno.test({
});
},
});
+
+// https://github.com/denoland/deno/issues/21734
+Deno.test({
+ name: "stringify options no encode",
+ fn() {
+ assertEquals(
+ stringify(
+ {
+ a: "hello",
+ b: 5,
+ c: true,
+ d: ["foo", "bar"],
+ },
+ "&",
+ "=",
+ {},
+ ),
+ "a=hello&b=5&c=true&d=foo&d=bar",
+ );
+ },
+});