Files
github-actions-magento2/supported-version/src/kind/validate-kinds.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

19 lines
693 B
TypeScript

import { validateKind } from "./validate-kinds";
describe('validateKind', () => {
it('returns `true` if its a valid kind', () => {
expect(validateKind("latest")).toBe(true);
});
it('throws a helpful exception if its an invalid kind', () => {
expect(() => validateKind(<any>"taco")).toThrow();
})
it('throws a helpful exception if custom versions are provided with the wrong kind', () => {
expect(() => validateKind(<any>"latest", [])).toThrow();
})
it('returns `true` for kind `custom` with a custom versions', () => {
expect(validateKind("custom", "mage-os/project-community-edition:1.0.0".split(","))).toBe(true);
})
})