Sha256: dd0e828afbef6fcf16a584357d064b53194f5d1d17c1da7e925fc53455b14cc5

Contents?: true

Size: 993 Bytes

Versions: 19

Compression:

Stored size: 993 Bytes

Contents

var request = request = require('../index')
  , assert = require('assert')
  ;
 

// Test adding a querystring
var req1 = request.get({ uri: 'http://www.google.com', qs: { q : 'search' }})
setTimeout(function() {
	assert.equal('/?q=search', req1.path)
}, 1)

// Test replacing a querystring value
var req2 = request.get({ uri: 'http://www.google.com?q=abc', qs: { q : 'search' }})
setTimeout(function() {
	assert.equal('/?q=search', req2.path)
}, 1)

// Test appending a querystring value to the ones present in the uri
var req3 = request.get({ uri: 'http://www.google.com?x=y', qs: { q : 'search' }})
setTimeout(function() {
	assert.equal('/?x=y&q=search', req3.path)
}, 1)

// Test leaving a querystring alone
var req4 = request.get({ uri: 'http://www.google.com?x=y'})
setTimeout(function() {
	assert.equal('/?x=y', req4.path)
}, 1)

// Test giving empty qs property
var req5 = request.get({ uri: 'http://www.google.com', qs: {}})
setTimeout(function(){
	assert.equal('/', req5.path)
}, 1)

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
ela-4.1.6 node_modules/request/tests/test-qs.js
ela-4.1.5 node_modules/request/tests/test-qs.js
ela-4.1.4 node_modules/request/tests/test-qs.js
ela-4.1.3 node_modules/request/tests/test-qs.js
ela-4.1.2 node_modules/request/tests/test-qs.js
ela-4.1.1 node_modules/request/tests/test-qs.js
ela-4.1.0 node_modules/request/tests/test-qs.js
ela-4.0.0 node_modules/request/tests/test-qs.js
ela-3.4.3 node_modules/request/tests/test-qs.js
ela-3.4.2 node_modules/request/tests/test-qs.js
ela-3.4.0 node_modules/request/tests/test-qs.js
ela-3.3.1 node_modules/request/tests/test-qs.js
ela-3.3.0 node_modules/request/tests/test-qs.js
ela-3.2.0 node_modules/request/tests/test-qs.js
ela-3.1.1 node_modules/request/tests/test-qs.js
ela-3.1.0 node_modules/request/tests/test-qs.js
ela-3.0.0 node_modules/request/tests/test-qs.js
ela-2.0.0 node_modules/request/tests/test-qs.js
ela-1.1.0 node_modules/request/tests/test-qs.js