Skip to content

Commit

Permalink
test: add tests to stringify for validation
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Sep 8, 2022
1 parent c77259e commit 9c780b3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/stringify.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { qsNoMungeTestCases, qsTestCases } from "./node";
import qs from "../lib";
import { test, assert } from "vitest";
import querystring from "querystring";

test("should stringify the basics", () => {
qsNoMungeTestCases.forEach((t) => {
Expand All @@ -13,3 +14,10 @@ test("should succeed on node.js tests", () => {
assert.deepEqual(qs.stringify(t[2]), t[1]);
});
});

test("native querystring module should match the test suite result", () => {
qsTestCases.forEach((t) => assert.deepEqual(querystring.stringify(t[2]), t[1]));
qsNoMungeTestCases.forEach(
(t) => assert.deepEqual(querystring.stringify(t[1]), t[0]),
);
});

0 comments on commit 9c780b3

Please sign in to comment.