/usr/local/lib/node_modules/pm2/node_modules/needle/test
NameSizeModeActions
utils/-0755rm
basic_auth_spec.js61390644editdlrm
compression_spec.js30270644editdlrm
cookies_spec.js101400644editdlrm
decoder_spec.js22300644editdlrm
errors_spec.js62950644editdlrm
headers_spec.js58100644editdlrm
helpers.js15380644editdlrm
long_string_spec.js6410644editdlrm
output_spec.js72920644editdlrm
parsing_spec.js135640644editdlrm
post_data_spec.js331190644editdlrm
proxy_spec.js49740644editdlrm
querystring_spec.js23290644editdlrm
redirect_spec.js110010644editdlrm
redirect_with_timeout.js13530644editdlrm
request_stream_spec.js53440644editdlrm
response_stream_spec.js37120644editdlrm
socket_pool_spec.js17620644editdlrm
url_spec.js28370644editdlrm
Edit: /usr/local/lib/node_modules/pm2/node_modules/needle/test/querystring_spec.js (2329B)
var should = require('should'), stringify = require('../lib/querystring').build; describe('stringify', function() { describe('with null', function() { it('throws', function() { (function() { var res = stringify(null); }).should.throw(); }) }) describe('with a number', function() { it('throws', function() { (function() { var res = stringify(100); }).should.throw(); }) }) describe('with a string', function() { describe('that is empty', function() { it('throws', function() { (function() { var res = stringify(''); }).should.throw(); }) }) describe('that doesnt contain an equal sign', function() { it('throws', function() { (function() { var res = stringify('boomshagalaga'); }).should.throw(); }) }) describe('that contains an equal sign', function() { it('works', function() { var res = stringify('hello=123'); res.should.eql('hello=123'); }) }) }) describe('with an array', function() { describe('with key val objects', function() { it('works', function() { var res = stringify([ {foo: 'bar'} ]); res.should.eql('foo=bar'); }) }) describe('where all elements are strings with an equal sign', function() { it('works', function() { var res = stringify([ 'bar=123', 'quux=' ]); res.should.eql('bar=123&quux='); }) }) describe('with random words', function() { it('throws', function() { (function() { var res = stringify(['hello', 'there']); }).should.throw(); }) }) describe('with integers', function() { it('throws', function() { (function() { var res = stringify([123, 432]); }).should.throw(); }) }) }) describe('with an object', function() { it('works', function() { var res = stringify({ test: 100 }); res.should.eql('test=100'); }) describe('with object where val is an array', function() { it('works', function() { var res = stringify({ foo: ['bar', 'baz'] }); res.should.eql('foo[]=bar&foo[]=baz'); }) }) describe('with object where val is an array of key val objects', function() { it('works', function() { var res = stringify({ foo: [{'1': 'bar'}, {'2': 'baz'}] }); res.should.eql('foo[][1]=bar&foo[][2]=baz'); }) }) }) })