[node] improve util.deprecate() typings, fix tests in v4 & v6 for TS >=2.3 (#18903)

* [node] improve util.deprecate() typings, fix tests in v4 & v6 for TS >=2.3

* [react-measure, react-svg-pan-zoom] fix lint errors

* [node] change deprecate() typings in v7, too
This commit is contained in:
Dimitri Benin
2017-08-14 20:18:10 +02:00
committed by Mohamed Hegazy
parent 8414ffb817
commit 5a3249593e
10 changed files with 35 additions and 10 deletions

View File

@@ -643,6 +643,12 @@ namespace util_tests {
var readPromised = util.promisify(fs.readFile);
var sampleRead: Promise<any> = readPromised(__filename).then((data: Buffer): void => { }).catch((error: Error): void => { });
assert(typeof util.promisify.custom === 'symbol');
// util.deprecate
const foo = () => {};
// $ExpectType () => void
util.deprecate(foo, 'foo() is deprecated, use bar() instead');
// $ExpectType <T extends Function>(fn: T, message: string) => T
util.deprecate(util.deprecate, 'deprecate() is deprecated, use bar() instead');
}
}