mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 04:49:15 +08:00
Clean up url tests and wrap in namespace
This commit is contained in:
@@ -249,18 +249,24 @@ function bufferTests() {
|
||||
/// Url tests : http://nodejs.org/api/url.html
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
url.format(url.parse('http://www.example.com/xyz'));
|
||||
namespace url_tests {
|
||||
{
|
||||
url.format(url.parse('http://www.example.com/xyz'));
|
||||
|
||||
// https://google.com/search?q=you're%20a%20lizard%2C%20gary
|
||||
url.format({
|
||||
protocol: 'https',
|
||||
host: "google.com",
|
||||
pathname: 'search',
|
||||
query: { q: "you're a lizard, gary" }
|
||||
});
|
||||
}
|
||||
|
||||
// https://google.com/search?q=you're%20a%20lizard%2C%20gary
|
||||
url.format({
|
||||
protocol: 'https',
|
||||
host: "google.com",
|
||||
pathname: 'search',
|
||||
query: { q: "you're a lizard, gary" }
|
||||
});
|
||||
|
||||
var helloUrl = url.parse('http://example.com/?hello=world', true)
|
||||
assert.equal(helloUrl.query.hello, 'world');
|
||||
{
|
||||
var helloUrl = url.parse('http://example.com/?hello=world', true)
|
||||
assert.equal(helloUrl.query.hello, 'world');
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/// util tests : https://nodejs.org/api/util.html ///
|
||||
|
||||
Reference in New Issue
Block a user