Skip to content

Commit

Permalink
add more tests for APM
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwizp committed Feb 12, 2020
1 parent cc02970 commit 1211d3d
Showing 1 changed file with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,44 @@ describe('toQuery', () => {
});

describe('fromQuery', () => {
it('should not encode the following characters', () => {
expect(
fromQuery({
a: true,
b: 5000,
c: ':'
})
).toEqual('a=true&b=5000&c=:');
});

it('should encode the following characters', () => {
expect(
fromQuery({
a: '@',
b: '.',
c: ';',
d: ' '
})
).toEqual('a=%40&b=.&c=%3B&d=%20');
});

it('should handle null and undefined', () => {
expect(
fromQuery({
a: undefined,
b: null
})
).toEqual('a=&b=');
});

it('should handle arrays', () => {
expect(
fromQuery({
arr: ['a', 'b']
})
).toEqual('arr=a%2Cb');
});

it('should parse object to string', () => {
expect(
fromQuery({
Expand Down

0 comments on commit 1211d3d

Please sign in to comment.