mirror of
https://github.com/yml2213/javascript.git
synced 2026-10-20 07:48:57 +08:00
18 lines
697 B
JavaScript
18 lines
697 B
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var index_1 = require("./index");
|
|
describe('utils function test', function () {
|
|
it('convert object containing primitive value to querystring', function () {
|
|
var obj = {
|
|
id: '1',
|
|
number: 12,
|
|
message: '你好'
|
|
};
|
|
expect(index_1.objectToQS(obj)).toBe('id=1&number=12&message=%E4%BD%A0%E5%A5%BD');
|
|
});
|
|
it('convert object containing no-primitive value to querystring', function () {
|
|
var obj = { userNumber: 1326099664, groupNumber: undefined };
|
|
expect(index_1.objectToQS(obj)).toBe('userNumber=1326099664');
|
|
});
|
|
});
|