Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Commit 6330344

Browse files
author
Hans Kristian Flaatten
committed
test(parser): add booleans to $in and $nin test cases
1 parent 3ce359b commit 6330344

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -352,23 +352,23 @@ describe('parse()', function() {
352352

353353
describe('$in / $nin operator', function() {
354354
it('returns in array query', function() {
355-
var string = 'foo[]=10&foo[]=10.011&foo[]=bar';
355+
var string = 'foo[]=10&foo[]=10.011&foo[]=bar&foo[]=true';
356356
var params = require('querystring').parse(string);
357357

358358
assert.deepEqual(qs.parse(params), {
359359
foo: {
360-
$in: [10, 10.011, 'bar']
360+
$in: [10, 10.011, 'bar', true]
361361
}
362362
});
363363
});
364364

365365
it('returns in array query with "qs" parser (GH-06)', function() {
366-
var string = 'foo[]=10&foo[]=10.011&foo[]=bar';
366+
var string = 'foo[]=10&foo[]=10.011&foo[]=bar&foo[]=true';
367367
var params = require('qs').parse(string);
368368

369369
assert.deepEqual(qs.parse(params), {
370370
foo: {
371-
$in: [10, 10.011, 'bar']
371+
$in: [10, 10.011, 'bar', true]
372372
}
373373
});
374374
});
@@ -385,23 +385,23 @@ describe('parse()', function() {
385385
});
386386

387387
it('returns not in array query', function() {
388-
var string = 'foo[]=!10&foo[]=!10.011&foo[]=!bar';
388+
var string = 'foo[]=!10&foo[]=!10.011&foo[]=!bar&foo[]=!false';
389389
var params = require('querystring').parse(string);
390390

391391
assert.deepEqual(qs.parse(params), {
392392
foo: {
393-
$nin: [10, 10.011, 'bar']
393+
$nin: [10, 10.011, 'bar', false]
394394
}
395395
});
396396
});
397397

398398
it('returns not in array query with "gs" parser (GH-06)', function() {
399-
var string = 'foo[]=!10&foo[]=!10.011&foo[]=!bar';
399+
var string = 'foo[]=!10&foo[]=!10.011&foo[]=!bar&foo[]=!false';
400400
var params = require('qs').parse(string);
401401

402402
assert.deepEqual(qs.parse(params), {
403403
foo: {
404-
$nin: [10, 10.011, 'bar']
404+
$nin: [10, 10.011, 'bar', false]
405405
}
406406
});
407407
});

0 commit comments

Comments
 (0)