Chore: Cleanup duplicated code in grafana-prometheus package (#89542)

* remove redundant test matchers

* use amendTable, trimTable functions from @grafana/data package

* move getMockDataSource function into the mocks.ts

* use LocalStorageValueProvider from @grafana/o11y-ds-frontend

* move all mocks under __mocks__ directory

* use store from @grafana/o11y-ds-frontend

* move test related files under test directory

* use getNextRefId from @grafana/data instead of deprecated getNextRefIdChar
See: https://github.com/grafana/grafana/pull/87460

* betterer

* remove unnecessary mockings

* import from @grafana/data

* import from @grafana/data
This commit is contained in:
ismail simsek
2024-07-03 16:21:29 +02:00
committed by GitHub
parent f659bc1f40
commit 7f5dde6ed3
30 changed files with 78 additions and 885 deletions

View File

@@ -455,24 +455,6 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "4"],
[0, 0, 0, "Unexpected any. Specify a different type.", "5"]
],
"packages/grafana-prometheus/src/gcopypaste/app/features/live/data/amendTimeSeries.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"],
[0, 0, 0, "Do not use any type assertions.", "2"],
[0, 0, 0, "Do not use any type assertions.", "3"],
[0, 0, 0, "Do not use any type assertions.", "4"]
],
"packages/grafana-prometheus/src/gcopypaste/public/test/matchers/index.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
],
"packages/grafana-prometheus/src/gcopypaste/public/test/matchers/toEmitValuesWith.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
[0, 0, 0, "Unexpected any. Specify a different type.", "2"]
],
"packages/grafana-prometheus/src/gcopypaste/public/test/matchers/utils.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
],
"packages/grafana-prometheus/src/language_provider.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],