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.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182/** Tests for the configuration error classes. @module */
import { describe, expect, it,} from '@monochromatic-dev/module-test/ts';
import { InvalidMaxAgeError, InvalidMaxSizeError,} from '../dist/final/neutral/index.mjs';
await describe({ name: '', children: [ describe({ name: InvalidMaxSizeError.name, children: [ it({ name: 'extends TypeError so existing TypeError handlers keep working', fn: async () => { const error = new InvalidMaxSizeError(); expect(error,).toBeInstanceOf(TypeError,); expect(error,).toBeInstanceOf(Error,); }, },),
it({ name: 'carries upstream quick-lru message text', fn: async () => { const error = new InvalidMaxSizeError(); expect(error.message,).toBe('`maxSize` must be a number greater than 0',); }, },),
it({ name: 'names itself for readable stacks', fn: async () => { const error = new InvalidMaxSizeError(); expect(error.name,).toBe('InvalidMaxSizeError',); }, },), ], },),
describe({ name: InvalidMaxAgeError.name, children: [ it({ name: 'extends TypeError so existing TypeError handlers keep working', fn: async () => { const error = new InvalidMaxAgeError(); expect(error,).toBeInstanceOf(TypeError,); expect(error,).toBeInstanceOf(Error,); }, },),
it({ name: 'carries upstream quick-lru message text', fn: async () => { const error = new InvalidMaxAgeError(); expect(error.message,).toBe('`maxAge` must be a number greater than 0',); }, },),
it({ name: 'names itself for readable stacks', fn: async () => { const error = new InvalidMaxAgeError(); expect(error.name,).toBe('InvalidMaxAgeError',); }, },), ], },), ],},);