If your method returns a
Promise
, you can use top-level await
to resolve the value instead of wrapping it in an async
IIFE.
import {expectType, expectError} from 'tsd'; import concat from '.'; expectType<Promise<string>>(concat('foo', 'bar')); expectType<string>(await concat('foo', 'bar')); expectError(await concat(true, false));