Prettier fixes
This commit is contained in:
@@ -1,21 +1,33 @@
|
||||
var tape = require("tape")
|
||||
var tape = require("tape");
|
||||
|
||||
var updateQueryString = require("../../../lib/util/update-query-string")
|
||||
var updateQueryString = require("../../../lib/util/update-query-string");
|
||||
|
||||
tape("test update query string method", function(t) {
|
||||
var url = "http://example.com"
|
||||
var updatedUrl = updateQueryString(url, "foo", "bar")
|
||||
var url = "http://example.com";
|
||||
var updatedUrl = updateQueryString(url, "foo", "bar");
|
||||
|
||||
t.notEqual(url, updatedUrl, "update query string modifies URL")
|
||||
t.equal(updatedUrl, url + "?foo=bar", "update query string creates new query string when no query string params are set")
|
||||
t.notEqual(url, updatedUrl, "update query string modifies URL");
|
||||
t.equal(
|
||||
updatedUrl,
|
||||
url + "?foo=bar",
|
||||
"update query string creates new query string when no query string params are set"
|
||||
);
|
||||
|
||||
updatedUrl = updateQueryString(updatedUrl, "foo", "baz")
|
||||
updatedUrl = updateQueryString(updatedUrl, "foo", "baz");
|
||||
|
||||
t.equal(updatedUrl, url + "?foo=baz", "update query string updates existing query string param")
|
||||
t.equal(
|
||||
updatedUrl,
|
||||
url + "?foo=baz",
|
||||
"update query string updates existing query string param"
|
||||
);
|
||||
|
||||
updatedUrl = updateQueryString(updatedUrl, "bar", "")
|
||||
updatedUrl = updateQueryString(updatedUrl, "bar", "");
|
||||
|
||||
t.equal(updatedUrl, url + "?foo=baz&bar=", "update query string appends to existing query string")
|
||||
t.equal(
|
||||
updatedUrl,
|
||||
url + "?foo=baz&bar=",
|
||||
"update query string appends to existing query string"
|
||||
);
|
||||
|
||||
t.end()
|
||||
})
|
||||
t.end();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user