svg-pathdata
Version:
Manipulate SVG path data (path[d] attribute content) simply and efficiently.
17 lines (15 loc) • 338 B
text/typescript
import { expect } from '@jest/globals';
import { YError } from 'yerror';
export function assertThrows<T>(
fn: () => void,
type: T,
message: string,
) {
try {
fn();
throw new YError('E_UNEXPECTED_SUCCESS');
} catch (err) {
expect(err).toBeInstanceOf(type);
expect((err as Error).message).toEqual(message);
}
}