Skip to content

Commit e26745f

Browse files
authored
Add axios' source to user tests (#23490)
* Add axios' source to user tests We already have the npm-installed version in order to test their d.ts so that we don't break their users. * Just compile lib, plus fix some config lint
1 parent f5101e2 commit e26745f

File tree

5 files changed

+67
-0
lines changed

5 files changed

+67
-0
lines changed

.gitmodules

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,8 @@
2929
[submodule "tests/cases/user/puppeteer/puppeteer"]
3030
path = tests/cases/user/puppeteer/puppeteer
3131
url = https://github.com/GoogleChrome/puppeteer.git
32+
ignore = all
33+
[submodule "tests/cases/user/axios-src/axios-src"]
34+
path = tests/cases/user/axios-src/axios-src
35+
url = https://github.com/axios/axios.git
36+
ignore = all
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
Exit Code: 1
2+
Standard output:
3+
lib/adapters/http.js(12,19): error TS2307: Cannot find module './../../package.json'.
4+
lib/adapters/http.js(83,22): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
5+
Type 'undefined' is not assignable to type 'string'.
6+
lib/adapters/http.js(189,23): error TS2345: Argument of type 'null' is not assignable to parameter of type 'string | undefined'.
7+
lib/adapters/http.js(195,44): error TS2345: Argument of type 'null' is not assignable to parameter of type 'string | undefined'.
8+
lib/adapters/http.js(201,13): error TS2322: Type 'string' is not assignable to type 'Buffer'.
9+
lib/adapters/http.js(213,40): error TS2345: Argument of type 'null' is not assignable to parameter of type 'string | undefined'.
10+
lib/adapters/http.js(237,42): error TS2345: Argument of type 'null' is not assignable to parameter of type 'string | undefined'.
11+
lib/adapters/xhr.js(29,16): error TS2339: Property 'XDomainRequest' does not exist on type 'Window'.
12+
lib/adapters/xhr.js(31,28): error TS2339: Property 'XDomainRequest' does not exist on type 'Window'.
13+
lib/adapters/xhr.js(80,7): error TS2322: Type 'null' is not assignable to type 'XMLHttpRequest'.
14+
lib/adapters/xhr.js(92,7): error TS2322: Type 'null' is not assignable to type 'XMLHttpRequest'.
15+
lib/adapters/xhr.js(99,51): error TS2345: Argument of type 'null' is not assignable to parameter of type 'string | undefined'.
16+
lib/adapters/xhr.js(102,7): error TS2322: Type 'null' is not assignable to type 'XMLHttpRequest'.
17+
lib/adapters/xhr.js(111,7): error TS2322: Type 'null' is not assignable to type 'XMLHttpRequest'.
18+
lib/adapters/xhr.js(181,9): error TS2322: Type 'null' is not assignable to type 'XMLHttpRequest'.
19+
lib/axios.js(23,3): error TS2554: Expected 3 arguments, but got 2.
20+
lib/axios.js(25,3): error TS2322: Type '(...args: any[]) => any' is not assignable to type 'Axios'.
21+
Property 'defaults' is missing in type '(...args: any[]) => any'.
22+
lib/axios.js(32,7): error TS2339: Property 'Axios' does not exist on type 'Axios'.
23+
lib/axios.js(35,7): error TS2339: Property 'create' does not exist on type 'Axios'.
24+
lib/axios.js(40,7): error TS2339: Property 'Cancel' does not exist on type 'Axios'.
25+
lib/axios.js(41,7): error TS2339: Property 'CancelToken' does not exist on type 'Axios'.
26+
lib/axios.js(42,7): error TS2339: Property 'isCancel' does not exist on type 'Axios'.
27+
lib/axios.js(45,7): error TS2339: Property 'all' does not exist on type 'Axios'.
28+
lib/axios.js(48,7): error TS2339: Property 'spread' does not exist on type 'Axios'.
29+
lib/cancel/CancelToken.js(37,12): error TS2339: Property 'reason' does not exist on type 'CancelToken'.
30+
lib/cancel/CancelToken.js(38,16): error TS2339: Property 'reason' does not exist on type 'CancelToken'.
31+
lib/core/enhanceError.js(14,9): error TS2339: Property 'config' does not exist on type 'Error'.
32+
lib/core/enhanceError.js(16,11): error TS2339: Property 'code' does not exist on type 'Error'.
33+
lib/core/enhanceError.js(18,9): error TS2339: Property 'request' does not exist on type 'Error'.
34+
lib/core/enhanceError.js(19,9): error TS2339: Property 'response' does not exist on type 'Error'.
35+
lib/core/settle.js(21,7): error TS2345: Argument of type 'null' is not assignable to parameter of type 'string | undefined'.
36+
lib/helpers/btoa.js(11,13): error TS2339: Property 'code' does not exist on type 'Error'.
37+
lib/helpers/btoa.js(31,13): error TS2532: Object is possibly 'undefined'.
38+
lib/helpers/cookies.js(16,56): error TS2551: Property 'toGMTString' does not exist on type 'Date'. Did you mean 'toUTCString'?
39+
lib/utils.js(244,20): error TS8029: JSDoc '@param' tag has name 'obj1', but there is no parameter with that name. It would match 'arguments' if it had an array type.
40+
lib/utils.js(268,20): error TS8029: JSDoc '@param' tag has name 'obj1', but there is no parameter with that name. It would match 'arguments' if it had an array type.
41+
42+
43+
44+
Standard error:

tests/cases/user/axios-src/axios-src

Submodule axios-src added at 0b3db5d

tests/cases/user/axios-src/test.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"types": ["node"]
3+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"compilerOptions": {
3+
"noImplicitAny": false,
4+
"noImplicitThis": false,
5+
"maxNodeModuleJsDepth": 0,
6+
"strict": true,
7+
"noEmit": true,
8+
"allowJs": true,
9+
"checkJs": true,
10+
"types": ["node"],
11+
"lib": ["esnext", "dom"],
12+
},
13+
"include": ["axios-src/lib"]
14+
}

0 commit comments

Comments
 (0)