@react-hookz/web
Version:
React hooks done right, for browser and SSR.
10 lines (9 loc) • 306 B
JavaScript
import { expect } from 'vitest';
/**
* Helper to assert that a hook result is successful and extract its value.
*/
export function expectResultValue(result) {
expect(result.error).toBeUndefined();
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
return result.value;
}