Skip to content

Commit

Permalink
Remove redundant x-pack/typings. (elastic#55042)
Browse files Browse the repository at this point in the history
  • Loading branch information
azasypkin authored and jkelastic committed Jan 17, 2020
1 parent 10fdbd1 commit b6019dc
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 72 deletions.
7 changes: 5 additions & 2 deletions x-pack/test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
]
},
"include": [
"**/*"
"**/*",
"../typings/**/*"
],
"exclude": []
"exclude": [
"../typings/jest.d.ts"
]
}
25 changes: 0 additions & 25 deletions x-pack/test/typings/hapi.d.ts

This file was deleted.

7 changes: 0 additions & 7 deletions x-pack/test/typings/hapi_basic.d.ts

This file was deleted.

28 changes: 0 additions & 28 deletions x-pack/test/typings/index.d.ts

This file was deleted.

9 changes: 0 additions & 9 deletions x-pack/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,6 @@ type Writable<T> = {
-readonly [K in keyof T]: T[K];
};

type MockedKeys<T> = { [P in keyof T]: jest.Mocked<Writable<T[P]>> };

type DeeplyMockedKeys<T> = {
[P in keyof T]: T[P] extends (...args: any[]) => any
? jest.MockInstance<ReturnType<T[P]>, Parameters<T[P]>>
: DeeplyMockedKeys<T[P]>;
} &
T;

// allow JSON files to be imported directly without lint errors
// see: https://github.com/palantir/tslint/issues/1264#issuecomment-228433367
// and: https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#arbitrary-expressions-are-forbidden-in-export-assignments-in-ambient-contexts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@
* you may not use this file except in compliance with the Elastic License.
*/

// https://github.com/styled-components/jest-styled-components/issues/264
type MockedKeys<T> = { [P in keyof T]: jest.Mocked<Writable<T[P]>> };

type DeeplyMockedKeys<T> = {
[P in keyof T]: T[P] extends (...args: any[]) => any
? jest.MockInstance<ReturnType<T[P]>, Parameters<T[P]>>
: DeeplyMockedKeys<T[P]>;
} &
T;

// https://github.com/styled-components/jest-styled-components/issues/264
declare namespace jest {
interface AsymmetricMatcher {
$$typeof: Symbol; //eslint-disable-line
Expand Down

0 comments on commit b6019dc

Please sign in to comment.