import { assertResultIsAnError } from './assertResultIsAnError' ; import { assertResultIsAnErrorWithMessage } from './assertResultIsAnErrorWithMessage' ; import { assertResultIsAValue } from './assertResultIsAValue' ; import { assertResultIsNotAnError } from './assertResultIsNotAnError' ; import { assertResultIsNotAnErrorWithMessage } from './assertResultIsNotAnErrorWithMessage' ; import { assertResultIsNotAValue } from './assertResultIsNotAValue' ; import { report } from '../../report' ; import { Result } from 'defekt' ; import { ResultAssertions } from './ResultAssertions' ; const getAssertionsForResult = function < TValue , TError extends Error > ( actual ) : ResultAssertions { return { aValue ( ) { report ( assertResultIsAValue ( actual ) ) ; } , anError ( ) { report ( assertResultIsAnError ( actual ) ) ; } , anErrorWithMessage ( expected ) { report ( assertResultIsAnErrorWithMessage ( actual , expected ) ) ; } } ; } ; const getNegatedAssertionsForResult = function < TValue , TError extends Error > ( actual ) : ResultAssertions { return { aValue ( ) { report ( assertResultIsNotAValue ( actual ) ) ; } , anError ( ) { report ( assertResultIsNotAnError ( actual ) ) ; } , anErrorWithMessage ( expected ) { report ( assertResultIsNotAnErrorWithMessage ( actual , expected ) ) ; } } ; } ; export { getAssertionsForResult , getNegatedAssertionsForResult } ;