Skip to content

Commit 275cad7

Browse files
committed
Fix ci/build
1 parent 54270a6 commit 275cad7

File tree

6 files changed

+24
-46
lines changed

6 files changed

+24
-46
lines changed

package-lock.json

Lines changed: 5 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "quickwit-datasource",
3-
"version": "0.5.0",
3+
"version": "0.5-beta.1",
44
"description": "Quickwit datasource",
55
"scripts": {
66
"build": "webpack -c ./.config/webpack/webpack.config.ts --env production",
@@ -84,7 +84,6 @@
8484
"react-dom": "^18.2.0",
8585
"react-select": "^5.10.2",
8686
"react-select-event": "^5.5.1",
87-
"rxjs": "^7.8.1",
8887
"tslib": "2.5.3",
8988
"usehooks-ts": "^3.1.0"
9089
},

src/components/QueryEditor/ElasticsearchQueryContext.test.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { render } from '@testing-library/react';
2-
import { renderHook } from '@testing-library/react-hooks';
1+
import { render, renderHook } from '@testing-library/react';
32
import React, { PropsWithChildren } from 'react';
43

54
import { CoreApp, getDefaultTimeRange } from '@grafana/data';
@@ -46,9 +45,13 @@ describe('ElasticsearchQueryContext', () => {
4645
// the following applies to all hooks in ElasticsearchQueryContext as they all share the same code.
4746
describe('useQuery Hook', () => {
4847
it('Should throw when used outside of ElasticsearchQueryContext', () => {
49-
const { result } = renderHook(() => useQuery());
50-
51-
expect(result.error).toBeTruthy();
48+
const consoleSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
49+
50+
expect(() => {
51+
renderHook(() => useQuery());
52+
}).toThrow();
53+
54+
consoleSpy.mockRestore();
5255
});
5356

5457
it('Should return the current query object', () => {

src/hooks/useFields.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { defaultBucketAgg, defaultMetricAgg } from '../queryDef';
99
import { ElasticsearchQuery, MetricAggregationType, BucketAggregationType } from '../types';
1010

1111
import { useFields } from './useFields';
12-
import { renderHook } from '@testing-library/react-hooks';
12+
import { renderHook } from '@testing-library/react';
1313

1414

1515

src/hooks/useNextId.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { ElasticDatasource } from '../datasource';
77
import { ElasticsearchQuery } from '../types';
88

99
import { useNextId } from './useNextId';
10-
import { renderHook } from '@testing-library/react-hooks';
10+
import { renderHook } from '@testing-library/react';
1111

1212
describe('useNextId', () => {
1313
it('Should return the next available id', () => {

src/hooks/useStatelessReducer.test.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { renderHook } from '@testing-library/react-hooks';
1+
import { renderHook } from '@testing-library/react';
22
import React, { PropsWithChildren } from 'react';
33

44
import { useStatelessReducer, useDispatch, DispatchContext, combineReducers } from './useStatelessReducer';
@@ -33,9 +33,13 @@ describe('useStatelessReducer Hook', () => {
3333

3434
describe('useDispatch Hook', () => {
3535
it('Should throw when used outside of DispatchContext', () => {
36-
const { result } = renderHook(() => useDispatch());
37-
38-
expect(result.error).toBeTruthy();
36+
const consoleSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
37+
38+
expect(() => {
39+
renderHook(() => useDispatch());
40+
}).toThrow();
41+
42+
consoleSpy.mockRestore();
3943
});
4044

4145
it('Should return a dispatch function', () => {

0 commit comments

Comments
 (0)