Files
github-actions-magento2/resolve-check-config/src/kind.spec.ts
T
Damien Retzinger 8a6a886d7e chore(deps): upgrade jest to v30
Bump jest ^29.5.0 -> ^30.4.2, @types/jest ^29.5.14 -> ^30.0.0, and
ts-jest ^29.4.6 -> ^29.4.11.

@types/jest@30 removes the deprecated `toThrowError` matcher type, so
migrate every `.toThrowError()` assertion to `.toThrow()`.
2026-06-09 17:33:49 -04:00

27 lines
793 B
TypeScript

import { assertKind, isKind } from './kind';
describe('isKind / assertKind', () => {
it('accepts "store"', () => {
expect(isKind('store')).toBe(true);
expect(assertKind('store')).toBe('store');
});
it('accepts "extension"', () => {
expect(isKind('extension')).toBe(true);
expect(assertKind('extension')).toBe('extension');
});
it('rejects other strings', () => {
expect(isKind('taco')).toBe(false);
expect(() => assertKind('taco')).toThrow(/`kind` must be 'store' or 'extension'/);
});
it('rejects empty input', () => {
expect(() => assertKind('')).toThrow(/`kind` must be 'store' or 'extension'/);
});
it('rejects non-string input', () => {
expect(() => assertKind(undefined)).toThrow(/`kind` must be 'store' or 'extension'/);
});
});