Skip to content

Custom Jest matchers causing issues with Jest upgrade #2671

@spalger

Description

@spalger

We're unable to upgrade jest because the custom jest matcher types in EUI are conflicting with the version of Jest we're trying to install. I don't think there's a good reason for these extensions personally, and would prefer if they could just be implemented as helper functions so that the types could be removed. Thoughts?

Kibana Jest upgrade: elastic/kibana#53079
Error from https://kibana-ci.elastic.co/job/elastic+kibana+pipeline-pull-request/15622/execution/node/128/log/

03:42:42  kibana: node_modules/@elastic/eui/eui.d.ts(5656,20): error TS2428: All declarations of 'Matchers' must have identical type parameters.
03:42:42  kibana: node_modules/@types/jest/index.d.ts(729,15): error TS2428: All declarations of 'Matchers' must have identical type parameters.

Problematic module:

declare module '@elastic/eui/src/components/datagrid/data_grid.test' {
	 global {
	    namespace jest {
	        interface Matchers<R> {
	            toBeEuiPopover(): R;
	            euiPopoverToBeOpen(): R;
	        }
	    }
	}
	export {};
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions