UNPKG

zod-error

Version:

Utilities to format and customize Zod error messages

8 lines (7 loc) 668 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const _1 = require("."); test('component options is enabled with label specified', () => expect((0, _1.getLabel)({ enabled: true, label: 'hello' }, 'Fallback: ')).toBe('hello')); test('component options are not specified ', () => expect((0, _1.getLabel)(undefined, 'Fallback: ')).toBe('Fallback: ')); test('component options are enabled but component is disabled', () => expect((0, _1.getLabel)({ enabled: false }, 'Fallback: ')).toBe('')); test('component options are enabled with the label disabled', () => expect((0, _1.getLabel)({ enabled: true, label: null }, 'Fallback: ')).toBe(''));