license import { NamedCase , UnnamedCase , _cases } from "../cases" ; import { Configuration , defaults } from "../configuration" ; import { Context } from "../context" ; import { fakeSchedulers as _fakeSchedulers } from "../fake" ; import { configure as _configure , MarblesFunction } from "../marbles" ; export * from "../configuration" ; export * from "../context" ; export * from "../expect" ; export * from "../fake" ; export { MarblesFunction } from "../marbles" ; export * from "./observe" ; declare const describe ; declare const expect ; declare const fit ; declare const it ; declare const xit ; export interface CasesFunction { < T extends UnnamedCase > ( name , func , cases ) : void ; < T extends NamedCase > ( name , func , cases ) : void ; } export function configure ( configuration ) { const { assert : defaultAssert } = defaults ( ) ; const { marbles } = _configure ( { ... defaults ( ) , assert : ( a , m ) => { const expectation = expect ( a ) ; if ( expectation . withContext ) { expect ( a ) . withContext ( m ) . toBeTruthy ( ) ; } else { defaultAssert ! ( a , m ) ; } } , assertDeepEqual : ( a , e ) => expect ( a ) . toEqual ( e ) , ... configuration , } ) ; function cases < T extends UnnamedCase > ( name , func , cases ) ; function cases < T extends NamedCase > ( name , func , cases ) ; function cases ( name , func , cases ) { describe ( name , ( ) => { _cases ( ( c ) => { const t = c . only ? fit : c . skip ? xit : it ; if ( func . length > 2 ) { t ( c . name , marbles ( ( m , second , ... rest ) => func ( m , c , second , ... rest ) ) ) ; } else { t ( c . name , marbles ( ( m , ... rest ) => func ( m , c , ... rest ) ) ) ; } } , cases ) ; } ) ; } return { cases , marbles } ; } const { cases , marbles } = configure ( { } ) ; export { cases , marbles } ; export function fakeSchedulers ( fakeTest ) { return _fakeSchedulers ( fakeTest ) ; }