Skip to content

Commit fb49fbb

Browse files
authored
Update user baselines (#24032)
* Strip absolute paths from import types in captured baseline * Accept updated user baselines
1 parent 36ff507 commit fb49fbb

19 files changed

+1579
-2307
lines changed

src/harness/externalCompileRunner.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,24 @@ class UserCodeRunner extends ExternalCompileRunnerBase {
9191
// tslint:disable-next-line:no-null-keyword
9292
return result.status === 0 && !result.stdout.length && !result.stderr.length ? null : `Exit Code: ${result.status}
9393
Standard output:
94-
${result.stdout.toString().replace(/\r\n/g, "\n")}
94+
${stripAbsoluteImportPaths(result.stdout.toString().replace(/\r\n/g, "\n"))}
9595
9696
9797
Standard error:
98-
${result.stderr.toString().replace(/\r\n/g, "\n")}`;
98+
${stripAbsoluteImportPaths(result.stderr.toString().replace(/\r\n/g, "\n"))}`;
9999
}
100100
}
101101

102+
/**
103+
* Import types and some other error messages use absolute paths in errors as they have no context to be written relative to;
104+
* This is problematic for error baselines, so we grep for them and strip them out.
105+
*/
106+
function stripAbsoluteImportPaths(result: string) {
107+
return result
108+
.replace(/import\(".*?\/tests\/cases\/user\//g, `import("/`)
109+
.replace(/Module '".*?\/tests\/cases\/user\//g, `Module '"/`);
110+
}
111+
102112
class DefinitelyTypedRunner extends ExternalCompileRunnerBase {
103113
readonly testDir = "../DefinitelyTyped/types/";
104114
workingDirectory = this.testDir;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Exit Code: 1
2+
Standard output:
3+
node_modules/@types/passport-facebook/index.d.ts(50,31): error TS2689: Cannot extend an interface 'passport.Strategy'. Did you mean 'implements'?
4+
5+
6+
7+
Standard error:

tests/baselines/reference/user/adonis-framework.log

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ node_modules/adonis-framework/src/Event/index.js(256,52): error TS2345: Argument
4444
Type 'Function' provides no match for the signature '(...values: any[]): void'.
4545
node_modules/adonis-framework/src/Event/index.js(264,28): error TS2345: Argument of type 'Function' is not assignable to parameter of type 'Listener'.
4646
node_modules/adonis-framework/src/Event/index.js(294,30): error TS2345: Argument of type 'Function' is not assignable to parameter of type 'Listener'.
47+
node_modules/adonis-framework/src/Exceptions/index.js(5,7): error TS2300: Duplicate identifier 'RuntimeException'.
4748
node_modules/adonis-framework/src/Exceptions/index.js(13,14): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
4849
node_modules/adonis-framework/src/Exceptions/index.js(27,12): error TS2554: Expected 0 arguments, but got 3.
4950
node_modules/adonis-framework/src/Exceptions/index.js(40,12): error TS2554: Expected 0 arguments, but got 3.
@@ -60,6 +61,7 @@ node_modules/adonis-framework/src/Exceptions/index.js(164,14): error TS1056: Acc
6061
node_modules/adonis-framework/src/Exceptions/index.js(178,12): error TS2554: Expected 0 arguments, but got 3.
6162
node_modules/adonis-framework/src/Exceptions/index.js(191,12): error TS2554: Expected 0 arguments, but got 3.
6263
node_modules/adonis-framework/src/Exceptions/index.js(205,12): error TS2554: Expected 0 arguments, but got 3.
64+
node_modules/adonis-framework/src/Exceptions/index.js(210,19): error TS2300: Duplicate identifier 'RuntimeException'.
6365
node_modules/adonis-framework/src/File/index.js(175,5): error TS2322: Type 'Promise<any>' is not assignable to type 'boolean'.
6466
node_modules/adonis-framework/src/File/index.js(273,5): error TS2322: Type 'boolean | ""' is not assignable to type 'boolean'.
6567
Type '""' is not assignable to type 'boolean'.
@@ -144,12 +146,7 @@ node_modules/adonis-framework/src/Session/Drivers/File/index.js(79,15): error TS
144146
node_modules/adonis-framework/src/Session/Drivers/Redis/index.js(23,14): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
145147
node_modules/adonis-framework/src/Session/Drivers/Redis/index.js(59,15): error TS2322: Type 'IterableIterator<any>' is not assignable to type 'boolean'.
146148
node_modules/adonis-framework/src/Session/Drivers/Redis/index.js(72,15): error TS2322: Type 'IterableIterator<any>' is not assignable to type 'boolean'.
147-
node_modules/adonis-framework/src/Session/SessionManager.js(13,21): error TS2307: Cannot find module 'adonis-fold'.
148-
node_modules/adonis-framework/src/Session/SessionManager.js(69,22): error TS2339: Property 'drivers' does not exist on type 'Function'.
149-
node_modules/adonis-framework/src/Session/SessionManager.js(69,49): error TS2339: Property 'drivers' does not exist on type 'Function'.
150-
node_modules/adonis-framework/src/Session/SessionManager.js(71,76): error TS2339: Property 'drivers' does not exist on type 'Function'.
151-
node_modules/adonis-framework/src/Session/Store.js(28,13): error TS2304: Cannot find name 'Mixed'.
152-
node_modules/adonis-framework/src/Session/Store.js(80,13): error TS2304: Cannot find name 'Mixed'.
149+
node_modules/adonis-framework/src/Session/index.js(10,14): error TS2304: Cannot find name 'SessionDriver'.
153150
node_modules/adonis-framework/src/Session/index.js(11,2): error TS1003: Identifier expected.
154151
node_modules/adonis-framework/src/Session/index.js(11,11): error TS2304: Cannot find name 'Class'.
155152
node_modules/adonis-framework/src/Session/index.js(46,15): error TS2304: Cannot find name 'SessionDriver'.
@@ -176,6 +173,12 @@ node_modules/adonis-framework/src/Session/index.js(249,15): error TS2304: Cannot
176173
node_modules/adonis-framework/src/Session/index.js(267,15): error TS2304: Cannot find name 'Mixed'.
177174
node_modules/adonis-framework/src/Session/index.js(287,15): error TS2322: Type 'IterableIterator<any>' is not assignable to type 'boolean'.
178175
node_modules/adonis-framework/src/Session/index.js(293,12): error TS2532: Object is possibly 'undefined'.
176+
node_modules/adonis-framework/src/Session/SessionManager.js(13,21): error TS2307: Cannot find module 'adonis-fold'.
177+
node_modules/adonis-framework/src/Session/SessionManager.js(69,22): error TS2339: Property 'drivers' does not exist on type 'Function'.
178+
node_modules/adonis-framework/src/Session/SessionManager.js(69,49): error TS2339: Property 'drivers' does not exist on type 'Function'.
179+
node_modules/adonis-framework/src/Session/SessionManager.js(71,76): error TS2339: Property 'drivers' does not exist on type 'Function'.
180+
node_modules/adonis-framework/src/Session/Store.js(28,13): error TS2304: Cannot find name 'Mixed'.
181+
node_modules/adonis-framework/src/Session/Store.js(80,13): error TS2304: Cannot find name 'Mixed'.
179182
node_modules/adonis-framework/src/View/Form/index.js(75,11): error TS2532: Object is possibly 'undefined'.
180183
node_modules/adonis-framework/src/View/Form/index.js(115,15): error TS2304: Cannot find name 'Mixed'.
181184
node_modules/adonis-framework/src/View/Form/index.js(147,63): error TS2345: Argument of type 'string | any[]' is not assignable to parameter of type 'any[]'.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Exit Code: 1
2+
Standard output:
3+
node_modules/antd/lib/_util/type.d.ts(8,63): error TS2344: Type 'keyof T' does not satisfy the constraint 'string'.
4+
Type 'string | number | symbol' is not assignable to type 'string'.
5+
Type 'number' is not assignable to type 'string'.
6+
7+
8+
9+
Standard error:

tests/baselines/reference/user/bluebird.log

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ node_modules/bluebird/js/release/debuggability.js(745,37): error TS2339: Propert
2424
node_modules/bluebird/js/release/debuggability.js(784,38): error TS2339: Property 'stack' does not exist on type 'CapturedTrace'.
2525
node_modules/bluebird/js/release/debuggability.js(793,25): error TS2554: Expected 0 arguments, but got 1.
2626
node_modules/bluebird/js/release/errors.js(10,49): error TS2350: Only a void function can be called with the 'new' keyword.
27-
node_modules/bluebird/js/release/errors.js(46,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{ (o: any, p: string, attributes: PropertyDescriptor & ThisType<any>): any; (o: any, propertyKey:...' has no compatible call signatures.
27+
node_modules/bluebird/js/release/errors.js(46,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType<any>) => any) | ...' has no compatible call signatures.
2828
node_modules/bluebird/js/release/errors.js(92,18): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{ <T>(a: T[]): ReadonlyArray<T>; <T extends Function>(f: T): T; <T>(o: T): Readonly<T>; } | ((obj...' has no compatible call signatures.
29-
node_modules/bluebird/js/release/errors.js(99,5): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{ (o: any, p: string, attributes: PropertyDescriptor & ThisType<any>): any; (o: any, propertyKey:...' has no compatible call signatures.
29+
node_modules/bluebird/js/release/errors.js(99,5): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType<any>) => any) | ...' has no compatible call signatures.
3030
node_modules/bluebird/js/release/generators.js(159,21): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
3131
node_modules/bluebird/js/release/generators.js(190,15): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
3232
node_modules/bluebird/js/release/generators.js(208,15): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
@@ -52,7 +52,7 @@ node_modules/bluebird/js/release/promise.js(4,12): error TS2351: Cannot use 'new
5252
node_modules/bluebird/js/release/promise.js(7,24): error TS2339: Property 'PromiseInspection' does not exist on type 'typeof Promise'.
5353
node_modules/bluebird/js/release/promise.js(10,27): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
5454
node_modules/bluebird/js/release/promise.js(20,32): error TS2322: Type 'null' is not assignable to type 'Domain'.
55-
node_modules/bluebird/js/release/promise.js(33,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{ (o: any, p: string, attributes: PropertyDescriptor & ThisType<any>): any; (o: any, propertyKey:...' has no compatible call signatures.
55+
node_modules/bluebird/js/release/promise.js(33,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType<any>) => any) | ...' has no compatible call signatures.
5656
node_modules/bluebird/js/release/promise.js(62,15): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
5757
node_modules/bluebird/js/release/promise.js(65,15): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
5858
node_modules/bluebird/js/release/promise.js(123,14): error TS2339: Property '_warn' does not exist on type 'Promise'.
@@ -155,11 +155,11 @@ node_modules/bluebird/js/release/some.js(133,23): error TS2339: Property 'promis
155155
node_modules/bluebird/js/release/using.js(78,20): error TS2339: Property 'doDispose' does not exist on type 'Disposer'.
156156
node_modules/bluebird/js/release/using.js(97,23): error TS2339: Property 'data' does not exist on type 'FunctionDisposer'.
157157
node_modules/bluebird/js/release/using.js(223,15): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
158-
node_modules/bluebird/js/release/util.js(97,5): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{ (o: any, p: string, attributes: PropertyDescriptor & ThisType<any>): any; (o: any, propertyKey:...' has no compatible call signatures.
158+
node_modules/bluebird/js/release/util.js(97,5): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType<any>) => any) | ...' has no compatible call signatures.
159159
node_modules/bluebird/js/release/util.js(201,5): error TS7027: Unreachable code detected.
160160
node_modules/bluebird/js/release/util.js(247,28): error TS2554: Expected 0 arguments, but got 2.
161-
node_modules/bluebird/js/release/util.js(275,17): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{ (o: any, p: string, attributes: PropertyDescriptor & ThisType<any>): any; (o: any, propertyKey:...' has no compatible call signatures.
162-
node_modules/bluebird/js/release/util.js(275,45): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{ (o: any, p: string): PropertyDescriptor | undefined; (o: any, propertyKey: PropertyKey): Proper...' has no compatible call signatures.
161+
node_modules/bluebird/js/release/util.js(275,17): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType<any>) => any) | ...' has no compatible call signatures.
162+
node_modules/bluebird/js/release/util.js(275,45): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((o: any, p: string | number | symbol) => PropertyDescriptor | undefined) | ((o: any, key: any) =...' has no compatible call signatures.
163163
node_modules/bluebird/js/release/util.js(363,25): error TS2304: Cannot find name 'chrome'.
164164
node_modules/bluebird/js/release/util.js(363,51): error TS2304: Cannot find name 'chrome'.
165165
node_modules/bluebird/js/release/util.js(364,25): error TS2304: Cannot find name 'chrome'.

0 commit comments

Comments
 (0)