import { Diagnostics } from '@kubb/core' import { describe, expect, it } from 'vitest' import { assertValidConfig } from './asserts.ts' describe('assertValidConfig', () => { it('accepts a config with an output path and known tools', () => { expect(() => assertValidConfig({ output: { path: 'src/gen', format: 'auto', lint: false } })).not.toThrow() }) it('throws KUBB_INVALID_CONFIG for a missing output path', () => { expect(() => assertValidConfig({ output: { path: '' } })).toThrow( expect.objectContaining({ diagnostic: expect.objectContaining({ code: Diagnostics.code.invalidConfig, message: expect.stringContaining('`output.path` is required: set it to the folder to generate into.'), }), }), ) }) })