mirror of
https://github.com/expo/sentry-react-native.git
synced 2026-11-14 19:12:28 -10:00
Co-authored-by: GitHub <[email protected]> Co-authored-by: Krystof Woldrich <[email protected]>
26 lines
881 B
TypeScript
26 lines
881 B
TypeScript
import { convertToNormalizedObject } from '../../src/js/utils/normalize';
|
|
|
|
describe('normalize', () => {
|
|
describe('convertToNormalizedObject', () => {
|
|
test('output equals input for normalized objects', () => {
|
|
const actualResult = convertToNormalizedObject({ foo: 'bar' });
|
|
expect(actualResult).toEqual({ foo: 'bar' });
|
|
});
|
|
|
|
test('converted output is normalized', () => {
|
|
const actualResult = convertToNormalizedObject({ foo: NaN });
|
|
expect(actualResult).toEqual({ foo: '[NaN]' });
|
|
});
|
|
|
|
test('converts a value to an object', () => {
|
|
const actualResult = convertToNormalizedObject('foo');
|
|
expect(actualResult).toEqual({ value: 'foo' });
|
|
});
|
|
|
|
test('converts null to an object', () => {
|
|
const actualResult = convertToNormalizedObject(null);
|
|
expect(actualResult).toEqual({ value: null });
|
|
});
|
|
});
|
|
});
|