Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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