Skip to content

Commit 61a95fd

Browse files
committed
test(utm): update validation tests to return undefined for null and non-object types
1 parent 34ea138 commit 61a95fd

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/utils/utm.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ import { validateUtmParams } from '../../src/utils/utm/utm';
22

33
describe('UTM Utils', () => {
44
describe('validateUtmParams', () => {
5-
it('should return empty object for undefined or null utm', () => {
6-
expect(validateUtmParams(undefined)).toEqual({});
7-
expect(validateUtmParams(null as any)).toEqual({});
5+
it('should return undefined for undefined or null utm', () => {
6+
expect(validateUtmParams(undefined)).toBeUndefined();
7+
expect(validateUtmParams(null as any)).toBeUndefined();
88
});
99

1010
it('should return empty object for empty object', () => {
1111
expect(validateUtmParams({})).toEqual({});
1212
});
1313

14-
it('should return empty object for non-object types', () => {
15-
expect(validateUtmParams('string' as any)).toEqual({});
16-
expect(validateUtmParams(123 as any)).toEqual({});
17-
expect(validateUtmParams(true as any)).toEqual({});
18-
expect(validateUtmParams([] as any)).toEqual({});
14+
it('should return undefined for non-object types', () => {
15+
expect(validateUtmParams('string' as any)).toBeUndefined();
16+
expect(validateUtmParams(123 as any)).toBeUndefined();
17+
expect(validateUtmParams(true as any)).toBeUndefined();
18+
expect(validateUtmParams([] as any)).toBeUndefined();
1919
});
2020

2121
it('should filter out invalid UTM keys', () => {

0 commit comments

Comments
 (0)