Skip to content

Commit a11a929

Browse files
committed
chore: Add "converter2" tests
1 parent 53126c6 commit a11a929

Some content is hidden

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

46 files changed

+1141
-3596
lines changed

.eslintrc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@
4141
},
4242
"overrides": [
4343
{
44-
"files": ["src/test/converter/**", "src/test/renderer/**"],
44+
"files": [
45+
"src/test/converter/**",
46+
"src/test/converter2/**",
47+
"src/test/renderer/**"
48+
],
4549
"rules": {
4650
"prefer-rest-params": 0,
4751
"no-inner-declarations": 0,

scripts/copy_test_files.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const { join } = require("path");
55

66
const copy = [
77
"test/converter",
8+
"test/converter2",
89
"test/renderer",
910
"test/module",
1011
"test/utils/options/readers/data",

src/test/converter/alias/alias.ts

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -17,87 +17,3 @@ export type IsString<T> = T extends string ? "string" : "not string";
1717
* Extracts the type of a promise.
1818
*/
1919
export type PromiseType<T> = T extends PromiseLike<infer U> ? U : T;
20-
21-
/**
22-
* Conditional type with infer
23-
*/
24-
export type PopFront<T extends any[]> = ((...args: T) => any) extends (
25-
a: any,
26-
...r: infer R
27-
) => any
28-
? R
29-
: never;
30-
31-
/**
32-
* See GH#1150. Calling typeChecker.typeToString on this type will send TS into an infinite
33-
* loop, which is undesirable.
34-
*/
35-
export type HorribleRecursiveTypeThatShouldNotBeUsedByAnyone<
36-
T extends any[],
37-
R = {}
38-
> = {
39-
0: R;
40-
1: HorribleRecursiveTypeThatShouldNotBeUsedByAnyone<
41-
PopFront<T>,
42-
{
43-
[K in keyof R | keyof T[0]]: K extends keyof R ? R[K] : T[0][K];
44-
}
45-
>;
46-
}[T["length"] extends 0 ? 0 : 1];
47-
48-
export namespace GH1330 {
49-
export type ExampleParam = Example;
50-
export interface Example<T extends ExampleParam = ExampleParam> {}
51-
52-
declare const makeExample: () => Example;
53-
declare const makeExample2: () => ExampleParam;
54-
55-
// Recursive type when we don't have a type node.
56-
export const testValue = makeExample();
57-
export const testValue2 = makeExample2();
58-
59-
export type HasProp<T> = { key: T };
60-
61-
declare const makeProp: <T>(x: T) => HasProp<T>;
62-
export const testValue3 = makeProp(1);
63-
}
64-
65-
export namespace GH1408 {
66-
export declare function foo<T extends unknown[]>(): T;
67-
}
68-
69-
export namespace GH1454 {
70-
export type Foo = string | number;
71-
export type Bar = string | number;
72-
73-
export declare function bar(x: Bar): Bar;
74-
export declare function foo(x: Foo): Foo;
75-
}
76-
77-
export namespace GH1547 {
78-
export interface ThingA {
79-
type: "ThingA";
80-
}
81-
82-
export interface ThingB {
83-
type: "ThingB";
84-
}
85-
86-
type Things = ThingA | ThingB;
87-
88-
type ValueOrArray<T> = T | Array<ValueOrArray<T>>;
89-
90-
/**
91-
* Test.
92-
*/
93-
export class Test {
94-
/**
95-
* Log a thing.
96-
*
97-
* @param things - Array of things or a thing.
98-
*/
99-
log_thing(things: ValueOrArray<Things>): void {
100-
console.log(things);
101-
}
102-
}
103-
}

0 commit comments

Comments
 (0)