|
|
|
@ -318,6 +318,14 @@ describe('Utility Methods', () => {
|
|
|
|
|
done();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('should get url params as arrays', (done) => {
|
|
|
|
|
const params = utils.params({ url: 'http://nodebb.org?foo=1&bar=test&herp[]=2&herp[]=3' });
|
|
|
|
|
assert.equal(params.foo, 1);
|
|
|
|
|
assert.equal(params.bar, 'test');
|
|
|
|
|
assert.deepStrictEqual(params.herp, [2, 3]);
|
|
|
|
|
done();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('should get a single param', (done) => {
|
|
|
|
|
assert.equal(utils.param('somekey'), undefined);
|
|
|
|
|
done();
|
|
|
|
|