@shopify/react-form-state
Version:
Manage react forms tersely and type-safe with no magic.
16 lines (14 loc) • 353 B
text/typescript
import {set} from '../utilities';
describe('utilities', () => {
describe('set', () => {
it("sets nested values when intermediary objects don't exist", () => {
const root = {};
const updated = set(root, ['ab', 'cd'], 'ef');
expect(updated).toMatchObject({
ab: {
cd: 'ef',
},
});
});
});
});