Skip to content

Commit 4510d48

Browse files
committedMar 20, 2025
JS: Add pre-existing expectations
1 parent d025d59 commit 4510d48

11 files changed

+37
-37
lines changed
 

‎javascript/ql/test/library-tests/UnderlyingTypes/calls.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as express from 'express';
33
function getRequest(): express.Request { }
44

55
function t1() {
6-
getRequest(); // $ hasUnderlyingType='express'.Request
6+
getRequest(); // $ MISSING: hasUnderlyingType='express'.Request
77
}
88

99
declare function getRequestAmbient(): express.Request;
@@ -17,16 +17,16 @@ class C {
1717
}
1818

1919
function t3(c: C) {
20-
c.method(); // $ hasUnderlyingType='express'.Request
21-
new C().method(); // $ hasUnderlyingType='express'.Request
20+
c.method(); // $ MISSING: hasUnderlyingType='express'.Request
21+
new C().method(); // $ MISSING: hasUnderlyingType='express'.Request
2222
}
2323

2424
function callback(fn: (req: express.Request) => void) { // $ SPURIOUS: hasUnderlyingType='express'.Request - req seems to be a SourceNode
2525
}
2626

2727
function t4() {
2828
callback(function (
29-
req // $ hasUnderlyingType='express'.Request
29+
req // $ MISSING: hasUnderlyingType='express'.Request
3030
) { }
3131
);
3232
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Request, Response } from './expressBulkExport';
22

3-
function t1(req: Request) { // $ hasUnderlyingType='express'.Request
3+
function t1(req: Request) { // $ MISSING: hasUnderlyingType='express'.Request SPURIOUS: hasUnderlyingType='expressBulkExport.ts'.Request
44
}
55

6-
function t2(res: Response) { // $ hasUnderlyingType='express'.Response
6+
function t2(res: Response) { // $ MISSING: hasUnderlyingType='express'.Response SPURIOUS: hasUnderlyingType='expressBulkExport.ts'.Response
77
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import { Request } from "./expressExportAssign";
22

3-
function t1(req: Request) { // $ hasUnderlyingType='express'.Request
3+
function t1(req: Request) { // $ MISSING: hasUnderlyingType='express'.Request SPURIOUS: hasUnderlyingType='expressExportAssign.ts'.Request
44
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import { E } from "./expressExportAssignWrapper";
22

3-
function t1(req: E.Request) { // $ hasUnderlyingType='express'.Request
3+
function t1(req: E.Request) { // $ MISSING: hasUnderlyingType='express'.Request
44
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { Request, Response, R } from './expressSelectiveExport';
22

3-
function t1(req: Request) { // $ hasUnderlyingType='express'.Request
3+
function t1(req: Request) { // $ MISSING: hasUnderlyingType='express'.Request SPURIOUS: hasUnderlyingType='expressSelectiveExport.ts'.Request
44
}
55

6-
function t2(res: Response) { // none, not exported
6+
function t2(res: Response) { // $ SPURIOUS: hasUnderlyingType='expressSelectiveExport.ts'.Response - none, not exported
77
}
88

9-
function t3(res: R) { // $ hasUnderlyingType='express'.Response
9+
function t3(res: R) { // $ MISSING: hasUnderlyingType='express'.Response SPURIOUS: hasUnderlyingType='expressSelectiveExport.ts'.R
1010
}
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
import { Request, Response, wrapper } from './expressWrapperExport';
22
import * as w from './expressWrapperExport';
33

4-
function t1(req: Request) { // none
4+
function t1(req: Request) { // $ SPURIOUS: hasUnderlyingType='expressWrapperExport.ts'.Request - none
55
}
66

7-
function t2(res: Response) { // none
7+
function t2(res: Response) { // $ SPURIOUS: hasUnderlyingType='expressWrapperExport.ts'.Response - none
88
}
99

10-
function t3(req: wrapper.Request) { // $ hasUnderlyingType='express'.Request
10+
function t3(req: wrapper.Request) { // $ MISSING: hasUnderlyingType='express'.Request
1111
}
1212

13-
function t4(res: wrapper.Response) { // $ hasUnderlyingType='express'.Response
13+
function t4(res: wrapper.Response) { // $ MISSING: hasUnderlyingType='express'.Response
1414
}
1515

16-
function t5(req: w.wrapper.Request) { // $ hasUnderlyingType='express'.Request
16+
function t5(req: w.wrapper.Request) { // $ MISSING: hasUnderlyingType='express'.Request
1717
}
1818

19-
function t6(res: w.wrapper.Response) { // $ hasUnderlyingType='express'.Response
19+
function t6(res: w.wrapper.Response) { // $ MISSING: hasUnderlyingType='express'.Response
2020
}
2121

22-
function t7(req: w.Request) { // none
22+
function t7(req: w.Request) { // $ SPURIOUS: hasUnderlyingType='expressWrapperExport.ts'.Request - none
2323
}
2424

25-
function t8(res: w.Response) { // none
25+
function t8(res: w.Response) { // $ SPURIOUS: hasUnderlyingType='expressWrapperExport.ts'.Response - none
2626
}
2727

28-
function t9(e: typeof w.wrapper) { // $ hasUnderlyingType='express'
28+
function t9(e: typeof w.wrapper) { // $ MISSING: hasUnderlyingType='express'
2929
}

‎javascript/ql/test/library-tests/UnderlyingTypes/jsdoc.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import { Response } from 'express';
44
/**
55
* @param {e.Request} req
66
*/
7-
function t1(req) { // $ hasUnderlyingType='express'.Request SPURIOUS: hasUnderlyingType=e.Request
7+
function t1(req) { // $ MISSING: hasUnderlyingType='express'.Request SPURIOUS: hasUnderlyingType=e.Request
88
}
99

1010
/**
1111
* @param {Response} res
1212
*/
13-
function t2(res) { // $ hasUnderlyingType='express'.Response SPURIOUS: hasUnderlyingType=Response
13+
function t2(res) { // $ MISSING: hasUnderlyingType='express'.Response SPURIOUS: hasUnderlyingType=Response
1414
}

‎javascript/ql/test/library-tests/UnderlyingTypes/namespaceDecls.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ namespace C {
1111
export const A = E;
1212
}
1313

14-
function t1(x: A.E.Request) { // $ hasUnderlyingType='express'.Request
14+
function t1(x: A.E.Request) { // $ MISSING: hasUnderlyingType='express'.Request
1515
}
1616

17-
function t2(x: B.Q.E.Request) { // $ hasUnderlyingType='express'.Request
17+
function t2(x: B.Q.E.Request) { // $ MISSING: hasUnderlyingType='express'.Request
1818
}
1919

20-
function t3(x: typeof Express) { // $ hasUnderlyingType='express'
20+
function t3(x: typeof Express) { // $ MISSING: hasUnderlyingType='express'
2121
}
2222

23-
function t4(x: typeof A.E) { // $ hasUnderlyingType='express'
23+
function t4(x: typeof A.E) { // $ MISSING: hasUnderlyingType='express'
2424
}
2525

26-
function t5(x: typeof C.A) { // $ hasUnderlyingType='express'
26+
function t5(x: typeof C.A) { // $ MISSING: hasUnderlyingType='express'
2727
}
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import * as express from 'express';
22

3-
function t1(e: typeof express) { // $ hasUnderlyingType='express'
3+
function t1(e: typeof express) { // $ MISSING: hasUnderlyingType='express'
44
}
55

66
function t2(req: express.Request) { // $ hasUnderlyingType='express'.Request
77
}
88

9-
function t3(req: Request) { // none, not in scope
9+
function t3(req: Request) { // $ SPURIOUS: hasUnderlyingType=Body hasUnderlyingType=Request - none, not in scope
1010
}
1111

1212
type E = typeof express;
1313

14-
function t4(e: E) { // $ hasUnderlyingType='express'
14+
function t4(e: E) { // $ MISSING: hasUnderlyingType='express'
1515
}

‎javascript/ql/test/library-tests/UnderlyingTypes/props.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ interface Foo {
66
}
77

88
function t1(f: Foo) {
9-
f.req; // $ hasUnderlyingType='express'.Request
10-
f.e; // $ hasUnderlyingType='express'
9+
f.req; // $ MISSING: hasUnderlyingType='express'.Request
10+
f.e; // $ MISSING: hasUnderlyingType='express'
1111

1212
const {
13-
req, // $ hasUnderlyingType='express'.Request
14-
e // $ hasUnderlyingType='express'
13+
req, // $ MISSING: hasUnderlyingType='express'.Request
14+
e // $ MISSING: hasUnderlyingType='express'
1515
} = f;
1616
}

‎javascript/ql/test/library-tests/UnderlyingTypes/subtype.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ interface MyRequest extends express.Request {
44

55
}
66

7-
function t1(req: MyRequest) { // $ hasUnderlyingType='express'.Request
7+
function t1(req: MyRequest) { // $ MISSING: hasUnderlyingType='express'.Request
88
}
99

1010
class MyRequestClass extends express.Request {
1111
}
1212

13-
function t2(req: MyRequestClass) { // $ hasUnderlyingType='express'.Request
13+
function t2(req: MyRequestClass) { // $ MISSING: hasUnderlyingType='express'.Request
1414
}
1515

1616
class MyRequestClass2 implements express.Request {
1717
}
1818

19-
function t3(req: MyRequestClass2) { // $ hasUnderlyingType='express'.Request
19+
function t3(req: MyRequestClass2) { // $ MISSING: hasUnderlyingType='express'.Request
2020
}

0 commit comments

Comments
 (0)