UNPKG

vue-styleguidist

Version:
43 lines 1.14 kB
import renderTypeString from './renderTypeString'; describe('renderTypeString', function () { it('should render an Array', function () { expect(renderTypeString({ name: 'Array' })).toMatchInlineSnapshot("\"Array\""); }); it('should render a composed type', function () { expect(renderTypeString({ name: 'Component', elements: [{ name: 'string' }, { name: 'number' }] })).toMatchInlineSnapshot("\"Component<string, number>\""); }); it('should render a union type', function () { expect(renderTypeString({ name: 'union', elements: [{ name: 'foo' }, { name: 'bar' }] })).toMatchInlineSnapshot("\"foo | bar\""); }); it('should render an intersection type', function () { expect(renderTypeString({ name: 'intersection', elements: [{ name: 'foo' }, { name: 'bar' }] })).toMatchInlineSnapshot("\"foo & bar\""); }); it('should render undefined as untyped', function () { expect(renderTypeString({ name: 'undefined' })).toMatchInlineSnapshot("\"-\""); }); });