diff --git a/types/es-abstract/test/es5.test.ts b/types/es-abstract/test/es5.test.ts index 0a913c922de322..4275146c98a413 100644 --- a/types/es-abstract/test/es5.test.ts +++ b/types/es-abstract/test/es5.test.ts @@ -2,6 +2,7 @@ import ES5 = require("es-abstract/es5"); import { expectType } from "./index.test"; declare const any: unknown; +declare const es5PrimitiveInput: string | number | boolean | object | null | undefined; const nullableObject: string | object | null | undefined = Math.random() < 0.5 ? (Math.random() < 0.5 ? undefined : null) : Object("foo"); @@ -27,7 +28,7 @@ ES5.Type([]); // $ExpectType "Object" expectType<"String" | "Number" | "Boolean" | "Null" | "Undefined" | "Object" | undefined>(ES5.Type(any)); expectType<"String" | "Number" | "Boolean" | "Null" | "Undefined" | "Object" | undefined>(ES5.Type(any)); -ES5.ToPrimitive(any); // $ExpectType string | number | bigint | boolean | symbol | null | undefined +expectType(ES5.ToPrimitive(es5PrimitiveInput)); ES5.ToBoolean(any); // $ExpectType boolean ES5.ToNumber(any); // $ExpectType number ES5.ToInteger(any); // $ExpectType number