mirror of
https://github.com/grpc/grpc-node.git
synced 2025-12-08 18:23:54 +00:00
17 lines
336 B
TypeScript
17 lines
336 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
|
|
}
|
|
}
|
|
}
|