Skip to content

Commit 2e9fb00

Browse files
Reduce the last ~2 years of uncovered top1000 repo failures into local tests (#64850)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 736819aa-5f3d-4bce-b59b-e63c38aaec88
1 parent 9de8b7a commit 2e9fb00

438 files changed

Lines changed: 9596 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎tsc/internal/execute/tsctests/tsc_test.go‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,43 @@ func TestTscCommandline(t *testing.T) {
325325
},
326326
}
327327

328+
for _, value := range []string{"false", "true", "omitted"} {
329+
option := ""
330+
if value != "omitted" {
331+
option = `, "alwaysStrict": ` + value
332+
}
333+
testCases = append(testCases, &tscInput{
334+
subScenario: "alwaysStrict " + value + " in configuration",
335+
files: FileMap{
336+
"/home/src/workspaces/project/tsconfig.json": fmt.Sprintf(`{"compilerOptions": {"target": "es2015"%s}}`, option),
337+
"/home/src/workspaces/project/index.ts": "export {};",
338+
},
339+
commandLineArgs: []string{"--noEmit"},
340+
})
341+
}
342+
for _, setting := range []struct {
343+
name string
344+
config string
345+
base string
346+
}{
347+
{"relative", `{"compilerOptions": {"target": "es2015", "baseUrl": "."}}`, ""},
348+
{"empty", `{"compilerOptions": {"target": "es2015", "baseUrl": ""}}`, ""},
349+
{"inherited", `{"extends": "./base.json"}`, `{"compilerOptions": {"target": "es2015", "baseUrl": "."}}`},
350+
{"omitted", `{"compilerOptions": {"target": "es2015"}}`, ""},
351+
} {
352+
files := FileMap{
353+
"/home/src/workspaces/project/tsconfig.json": setting.config,
354+
"/home/src/workspaces/project/index.ts": "export {};",
355+
}
356+
if setting.base != "" {
357+
files["/home/src/workspaces/project/base.json"] = setting.base
358+
}
359+
testCases = append(testCases, &tscInput{
360+
subScenario: "baseUrl " + setting.name + " in configuration",
361+
files: files,
362+
commandLineArgs: []string{"--noEmit"},
363+
})
364+
}
328365
for _, testCase := range testCases {
329366
testCase.run(t, "commandLine")
330367
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//// [tests/cases/compiler/assertedGenericPartialIndexedAssignment.ts] ////
2+
3+
=== assertedGenericPartialIndexedAssignment.ts ===
4+
function write<T extends Record<string, unknown>>(values: Partial<T>, key: string) {
5+
>write : Symbol(write, Decl(assertedGenericPartialIndexedAssignment.ts, 0, 0))
6+
>T : Symbol(T, Decl(assertedGenericPartialIndexedAssignment.ts, 0, 15))
7+
>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --))
8+
>values : Symbol(values, Decl(assertedGenericPartialIndexedAssignment.ts, 0, 50))
9+
>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --))
10+
>T : Symbol(T, Decl(assertedGenericPartialIndexedAssignment.ts, 0, 15))
11+
>key : Symbol(key, Decl(assertedGenericPartialIndexedAssignment.ts, 0, 69))
12+
13+
(values[key] as unknown) = 0;
14+
>values : Symbol(values, Decl(assertedGenericPartialIndexedAssignment.ts, 0, 50))
15+
>key : Symbol(key, Decl(assertedGenericPartialIndexedAssignment.ts, 0, 69))
16+
}
17+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//// [tests/cases/compiler/assertedGenericPartialIndexedAssignment.ts] ////
2+
3+
=== assertedGenericPartialIndexedAssignment.ts ===
4+
function write<T extends Record<string, unknown>>(values: Partial<T>, key: string) {
5+
>write : <T extends Record<string, unknown>>(values: Partial<T>, key: string) => void
6+
>values : Partial<T>
7+
>key : string
8+
9+
(values[key] as unknown) = 0;
10+
>(values[key] as unknown) = 0 : 0
11+
>(values[key] as unknown) : unknown
12+
>values[key] as unknown : unknown
13+
>values[key] : T[string] | undefined
14+
>values : Partial<T>
15+
>key : string
16+
>0 : 0
17+
}
18+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//// [tests/cases/compiler/assertedReadonlyParameterPropertyAssignment.ts] ////
2+
3+
=== assertedReadonlyParameterPropertyAssignment.ts ===
4+
class ReadonlyState {
5+
>ReadonlyState : Symbol(ReadonlyState, Decl(assertedReadonlyParameterPropertyAssignment.ts, 0, 0))
6+
7+
constructor(readonly value: object) {}
8+
>value : Symbol(ReadonlyState.value, Decl(assertedReadonlyParameterPropertyAssignment.ts, 1, 16))
9+
10+
clear() {
11+
>clear : Symbol(ReadonlyState.clear, Decl(assertedReadonlyParameterPropertyAssignment.ts, 1, 42))
12+
13+
(this.value as unknown) = null;
14+
>this.value : Symbol(ReadonlyState.value, Decl(assertedReadonlyParameterPropertyAssignment.ts, 1, 16))
15+
>this : Symbol(ReadonlyState, Decl(assertedReadonlyParameterPropertyAssignment.ts, 0, 0))
16+
>value : Symbol(ReadonlyState.value, Decl(assertedReadonlyParameterPropertyAssignment.ts, 1, 16))
17+
}
18+
}
19+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//// [tests/cases/compiler/assertedReadonlyParameterPropertyAssignment.ts] ////
2+
3+
=== assertedReadonlyParameterPropertyAssignment.ts ===
4+
class ReadonlyState {
5+
>ReadonlyState : ReadonlyState
6+
7+
constructor(readonly value: object) {}
8+
>value : object
9+
10+
clear() {
11+
>clear : () => void
12+
13+
(this.value as unknown) = null;
14+
>(this.value as unknown) = null : null
15+
>(this.value as unknown) : unknown
16+
>this.value as unknown : unknown
17+
>this.value : object
18+
>this : this
19+
>value : object
20+
}
21+
}
22+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//// [tests/cases/compiler/callableConstructorUnionMetadata.ts] ////
2+
3+
=== callableConstructorUnionMetadata.ts ===
4+
type Component<Props> = ((props: Props) => number) | (new (props: Props) => object);
5+
>Component : Symbol(Component, Decl(callableConstructorUnionMetadata.ts, 0, 0))
6+
>Props : Symbol(Props, Decl(callableConstructorUnionMetadata.ts, 0, 15))
7+
>props : Symbol(props, Decl(callableConstructorUnionMetadata.ts, 0, 26))
8+
>Props : Symbol(Props, Decl(callableConstructorUnionMetadata.ts, 0, 15))
9+
>props : Symbol(props, Decl(callableConstructorUnionMetadata.ts, 0, 59))
10+
>Props : Symbol(Props, Decl(callableConstructorUnionMetadata.ts, 0, 15))
11+
12+
type Field<Props> = Component<Props> & { testIds?: {} };
13+
>Field : Symbol(Field, Decl(callableConstructorUnionMetadata.ts, 0, 84))
14+
>Props : Symbol(Props, Decl(callableConstructorUnionMetadata.ts, 1, 11))
15+
>Component : Symbol(Component, Decl(callableConstructorUnionMetadata.ts, 0, 0))
16+
>Props : Symbol(Props, Decl(callableConstructorUnionMetadata.ts, 1, 11))
17+
>testIds : Symbol(testIds, Decl(callableConstructorUnionMetadata.ts, 1, 40))
18+
19+
declare const component: <Props>(props: Props) => number;
20+
>component : Symbol(component, Decl(callableConstructorUnionMetadata.ts, 3, 13))
21+
>Props : Symbol(Props, Decl(callableConstructorUnionMetadata.ts, 3, 26))
22+
>props : Symbol(props, Decl(callableConstructorUnionMetadata.ts, 3, 33))
23+
>Props : Symbol(Props, Decl(callableConstructorUnionMetadata.ts, 3, 26))
24+
25+
const field: Field<string> = component;
26+
>field : Symbol(field, Decl(callableConstructorUnionMetadata.ts, 4, 5))
27+
>Field : Symbol(Field, Decl(callableConstructorUnionMetadata.ts, 0, 84))
28+
>component : Symbol(component, Decl(callableConstructorUnionMetadata.ts, 3, 13))
29+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//// [tests/cases/compiler/callableConstructorUnionMetadata.ts] ////
2+
3+
=== callableConstructorUnionMetadata.ts ===
4+
type Component<Props> = ((props: Props) => number) | (new (props: Props) => object);
5+
>Component : Component<Props>
6+
>props : Props
7+
>props : Props
8+
9+
type Field<Props> = Component<Props> & { testIds?: {} };
10+
>Field : Field<Props>
11+
>testIds : {} | undefined
12+
13+
declare const component: <Props>(props: Props) => number;
14+
>component : <Props>(props: Props) => number
15+
>props : Props
16+
17+
const field: Field<string> = component;
18+
>field : Field<string>
19+
>component : <Props>(props: Props) => number
20+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//// [tests/cases/compiler/callableWeakMetadata.ts] ////
2+
3+
=== callableWeakMetadata.ts ===
4+
type Initializer = (() => number) & { mutators?: [] };
5+
>Initializer : Symbol(Initializer, Decl(callableWeakMetadata.ts, 0, 0))
6+
>mutators : Symbol(mutators, Decl(callableWeakMetadata.ts, 0, 37))
7+
8+
declare function createStore(initializer: Initializer): void;
9+
>createStore : Symbol(createStore, Decl(callableWeakMetadata.ts, 0, 54))
10+
>initializer : Symbol(initializer, Decl(callableWeakMetadata.ts, 2, 29))
11+
>Initializer : Symbol(Initializer, Decl(callableWeakMetadata.ts, 0, 0))
12+
13+
createStore(() => 1);
14+
>createStore : Symbol(createStore, Decl(callableWeakMetadata.ts, 0, 54))
15+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//// [tests/cases/compiler/callableWeakMetadata.ts] ////
2+
3+
=== callableWeakMetadata.ts ===
4+
type Initializer = (() => number) & { mutators?: [] };
5+
>Initializer : Initializer
6+
>mutators : [] | undefined
7+
8+
declare function createStore(initializer: Initializer): void;
9+
>createStore : (initializer: Initializer) => void
10+
>initializer : Initializer
11+
12+
createStore(() => 1);
13+
>createStore(() => 1) : void
14+
>createStore : (initializer: Initializer) => void
15+
>() => 1 : () => number
16+
>1 : 1
17+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//// [tests/cases/compiler/callableWeakMetadataCallSuggestion.ts] ////
2+
3+
=== callableWeakMetadataCallSuggestion.ts ===
4+
type Initializer = (() => number) & { mutators?: [] };
5+
>Initializer : Symbol(Initializer, Decl(callableWeakMetadataCallSuggestion.ts, 0, 0))
6+
>mutators : Symbol(mutators, Decl(callableWeakMetadataCallSuggestion.ts, 0, 37))
7+
8+
declare function createStore(initializer: Initializer): void;
9+
>createStore : Symbol(createStore, Decl(callableWeakMetadataCallSuggestion.ts, 0, 54))
10+
>initializer : Symbol(initializer, Decl(callableWeakMetadataCallSuggestion.ts, 2, 29))
11+
>Initializer : Symbol(Initializer, Decl(callableWeakMetadataCallSuggestion.ts, 0, 0))
12+
13+
declare const initializer: () => any;
14+
>initializer : Symbol(initializer, Decl(callableWeakMetadataCallSuggestion.ts, 3, 13))
15+
16+
createStore(initializer);
17+
>createStore : Symbol(createStore, Decl(callableWeakMetadataCallSuggestion.ts, 0, 54))
18+
>initializer : Symbol(initializer, Decl(callableWeakMetadataCallSuggestion.ts, 3, 13))
19+

0 commit comments

Comments
 (0)