Add extra test cases for string literal completions (#54714)

This commit is contained in:
Mateusz Burzyński 2023-06-20 18:52:38 +02:00 committed by GitHub
parent f415b196fc
commit b1c2e8caad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,10 @@
/// <reference path="fourslash.ts" />
// @strict: true
////
//// declare function func<
//// const T extends 'a' | 'b' | undefined = undefined,
//// >(arg?: T): string;
////
//// func('/*1*/');
verify.completions({ marker: ["1"], exact: [`a`, `b`] });

View File

@ -0,0 +1,16 @@
/// <reference path="fourslash.ts" />
// @strict: true
////
//// interface Func {
//// <Key extends "a" | "b">(
//// ...args:
//// | [key: Key, options?: any]
//// | [key: Key, defaultValue: string, options?: any]
//// ): string;
//// }
////
//// declare const func: Func;
////
//// func("/*1*/");
verify.completions({ marker: ["1"], exact: [`a`, `b`] });