Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/Aquaticat/Monochromatic. TypeScript and Rust monorepo: Claude Code and Pi coding-agent plugins, a m
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445import { describe, expect, it,} from '@monochromatic-dev/module-test/ts';
import { TomlEditError, TomlImmutableNodeError, TomlPathNotFoundError, TomlSpliceUnavailableError, TomlTypeError,} from '@monochromatic-dev/module-toml-edit';
await describe({ name: 'public TOML error classes', children: [ it({ name: 'retain their names and shared base type', fn: async () => { const cases = [ [new TomlEditError('base',), 'TomlEditError',], [new TomlPathNotFoundError('missing',), 'TomlPathNotFoundError',], [new TomlSpliceUnavailableError('mode',), 'TomlSpliceUnavailableError',], [new TomlTypeError('value',), 'TomlTypeError',], [new TomlImmutableNodeError('node',), 'TomlImmutableNodeError',], ] as const; for (const [error, name,] of cases) { expect(error.name,).toBe(name,); expect(error,).toBeInstanceOf(TomlEditError,); } }, },), it({ name: 'retains the supplied cause', fn: async () => { const cause = new Error('origin',); const error = new TomlEditError('failed', { cause, },); expect(error.cause,).toBe(cause,); expect(error.message,).toBe('failed',); }, },), ],},);