/**
 * By default, asynchronous tests that use JasmineTimeoutManager will have this
 * timeout, in milliseconds.
 */ export const DEFAULT_TIMEOUT = 250 ; /**
 * Utility for use in the beforeEach / afterEach methods of jasmine test suites,
 * to override the clock and timeout duration used for tests.
 */ export class JasmineTimeoutManager { private lastTimeout : number ; private timeout : number ; constructor ( desiredTimeout = DEFAULT_TIMEOUT ) { this . timeout = this . isValidTimeout ( desiredTimeout ) ? desiredTimeout : DEFAULT_TIMEOUT ; } install ( newTimeout = DEFAULT_TIMEOUT ) { this . lastTimeout = jasmine . DEFAULT_TIMEOUT_INTERVAL ; jasmine . DEFAULT_TIMEOUT_INTERVAL = this . isValidTimeout ( newTimeout ) ? newTimeout : this . timeout ; jasmine . clock ( ) . install ( ) ; } uninstall ( ) { jasmine . DEFAULT_TIMEOUT_INTERVAL = this . lastTimeout ; jasmine . clock ( ) . uninstall ( ) ; } isValidTimeout ( timeout ? ) { return ( timeout && timeout > 0 ) ; } }