This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
website/hooks/useForm/replaceEmptyStringInObjectToNull.test.ts

21 lines
481 B
TypeScript
Raw Normal View History

import { replaceEmptyStringInObjectToNull } from './replaceEmptyStringInObjectToNull'
describe('tools/utils/replaceEmptyStringInObjectToNull', () => {
it('should replace empty string in object to null except for required properties', () => {
expect(
replaceEmptyStringInObjectToNull(
{
foo: '',
bar: 'bar',
baz: ''
},
['baz']
)
).toEqual({
foo: null,
bar: 'bar',
baz: ''
})
})
})