From 9c780b3845305ac874c5a99e46fcb19d8d5b5b26 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Thu, 8 Sep 2022 16:56:46 -0400 Subject: [PATCH] test: add tests to stringify for validation --- test/stringify.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/stringify.test.ts b/test/stringify.test.ts index b19c086..1d5ca25 100644 --- a/test/stringify.test.ts +++ b/test/stringify.test.ts @@ -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) => { @@ -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]), + ); +});