grpc-node/test/common.ts
Kelvin Jin b2dc9dd53e Add Call & Channel Credentials, and accompanying tests (#7)
* Add ChannelCredential tests

* Work on channel credentials

* Remove context.context checks

* Make call credentials an interface

* Write comments for call credentials

* fixtures comment in test-channel-credentials

* small changes

* Address name change comment

* define metadata interface

* Call credentials

* Reorganize channel-credentials file

* Composed call credentials tests

* Simplified CallCredentials composition

* Use async.parallel in call-credentials
2017-08-17 13:56:37 -07:00

17 lines
337 B
TypeScript

import * as assert from 'assert';
export function mockFunction(): never {
throw new Error('Not implemented');
}
export namespace assert2 {
export function noThrowAndReturn<T>(fn: () => T): T {
try {
return fn();
} catch (e) {
assert.throws(() => { throw e });
throw e; // for type safety only
}
}
}