From 3d8fbf2328220c06e45f166cdf58e70617c7ee68 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Thu, 29 Feb 2024 00:52:20 +0700 Subject: [PATCH] Add tests for #381 Closes #381 --- test/parse-url.js | 1 + test/parse.js | 1 + 2 files changed, 2 insertions(+) diff --git a/test/parse-url.js b/test/parse-url.js index a6c0848..35f8ae4 100644 --- a/test/parse-url.js +++ b/test/parse-url.js @@ -5,6 +5,7 @@ test('handles strings with query string', t => { t.deepEqual(queryString.parseUrl('https://foo.bar#top?foo=bar'), {url: 'https://foo.bar', query: {}}); t.deepEqual(queryString.parseUrl('https://foo.bar?foo=bar&foo=baz#top'), {url: 'https://foo.bar', query: {foo: ['bar', 'baz']}}); t.deepEqual(queryString.parseUrl('https://foo.bar?foo=bar&foo=baz'), {url: 'https://foo.bar', query: {foo: ['bar', 'baz']}}); + t.deepEqual(queryString.parseUrl('https://foo.bar?foo=null'), {url: 'https://foo.bar', query: {foo: 'null'}}); }); test('handles strings not containing query string', t => { diff --git a/test/parse.js b/test/parse.js index e4904e9..17de629 100644 --- a/test/parse.js +++ b/test/parse.js @@ -20,6 +20,7 @@ test('query strings ending with a `&`', t => { test('parse a query string', t => { t.deepEqual(queryString.parse('foo=bar'), {foo: 'bar'}); + t.deepEqual(queryString.parse('foo=null'), {foo: 'null'}); }); test('parse multiple query string', t => {