Skip to content

Commit

Permalink
fix issue with ?null= - jsdom is more forgiving than chrome on `new…
Browse files Browse the repository at this point in the history
… URLSearchParams(null)`
  • Loading branch information
TomK committed Aug 23, 2021
1 parent c027eb8 commit 4a463c4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@packaged-ui/request",
"main": "src/request.js",
"version": "1.0.2",
"version": "1.0.3",
"type": "module",
"private": false,
"repository": "[email protected]:packaged-ui/request.git",
Expand Down
2 changes: 1 addition & 1 deletion src/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export default class Request
.join('&');
}
}
else
else if(this.data !== undefined && this.data !== null)
{
if(_method === Request.GET)
{
Expand Down
4 changes: 2 additions & 2 deletions test/_setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import {JSDOM} from 'jsdom';

export const port = 8877;
export const server = 'http://127.0.0.1:' + port;
export const serverUrl = 'http://127.0.0.1:' + port;

export const jsdom = new JSDOM('<!doctype html><html lang="en"><body></body></html>', {url: server});
export const jsdom = new JSDOM('<!doctype html><html lang="en"><body></body></html>', {url: serverUrl});
const {window} = jsdom;

function copyProps(src, target)
Expand Down
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {port as _p, server as _s} from './_setup.js';
import {port as _p, serverUrl as _s} from './_setup.js';
import http from 'http';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
Expand Down

0 comments on commit 4a463c4

Please sign in to comment.