///
///
///
///
import reactivity = require('reactivity')
import assert = require('assert')
import events = require('events')
import should = require('should')
import syncify = require('./syncify')
import util = require('./util')
interface Done { (): void }
function echo_async( v: T, cb:( e: Error, r?: T ) => void ): void {
setTimeout( () => { ( ( v ) === 'error' ) ? cb( new Error() ) : cb( null, v ) } , 10 )
}
var echo: { ( v:T ): T } = syncify( echo_async )
describe( "syncify", () => {
it("should return a function", () => {
should.equal( typeof echo, 'function' )
})
})
describe( "a syncified function", () => {
it("should throw an error when called outside an evaluation context", () => {
echo.should.throw()
})
})