diff options
author | crowlKats <crowlkats@gmail.com> | 2020-03-14 21:43:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-14 16:43:49 -0400 |
commit | 9648d3da1483ab77d9133ecd32fa240a597134eb (patch) | |
tree | e5b55592e9f7a94709e1c69528aa98dae0974edc /std/node/querystring_test.ts | |
parent | 92bbce04b9a268a9f87e1993a39fffb852c508ec (diff) |
Add node querystring polyfill (#4370)
Diffstat (limited to 'std/node/querystring_test.ts')
-rw-r--r-- | std/node/querystring_test.ts | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/std/node/querystring_test.ts b/std/node/querystring_test.ts new file mode 100644 index 000000000..d8cb1ec35 --- /dev/null +++ b/std/node/querystring_test.ts @@ -0,0 +1,30 @@ +const { test } = Deno; +import { assertEquals } from "../testing/asserts.ts"; +import { stringify, parse } from "./querystring.ts"; + +test({ + name: "stringify", + fn() { + assertEquals( + stringify({ + a: "hello", + b: 5, + c: true, + d: ["foo", "bar"] + }), + "a=hello&b=5&c=true&d=foo&d=bar" + ); + } +}); + +test({ + name: "parse", + fn() { + assertEquals(parse("a=hello&b=5&c=true&d=foo&d=bar"), { + a: "hello", + b: "5", + c: "true", + d: ["foo", "bar"] + }); + } +}); |