mirror of
https://github.com/Unleash/unleash.git
synced 2024-11-01 19:07:38 +01:00
b2b0958573
* refactor: improve parameter value string casting * fix: ensure that param values from /api/admin/features are strings
17 lines
626 B
TypeScript
17 lines
626 B
TypeScript
import { ensureStringValue } from './ensureStringValue';
|
|
|
|
test('ensureStringValue', () => {
|
|
expect(ensureStringValue(null)).toEqual('');
|
|
expect(ensureStringValue(undefined)).toEqual('');
|
|
expect(ensureStringValue('null')).toEqual('null');
|
|
expect(ensureStringValue('undefined')).toEqual('undefined');
|
|
|
|
expect(ensureStringValue('')).toEqual('');
|
|
expect(ensureStringValue('a')).toEqual('a');
|
|
expect(ensureStringValue(0)).toEqual('0');
|
|
expect(ensureStringValue(true)).toEqual('true');
|
|
|
|
expect(ensureStringValue({})).toEqual('{}');
|
|
expect(ensureStringValue({ b: 1 })).toEqual('{"b":1}');
|
|
});
|