Skip to content

Commit dd02285

Browse files
committed
change toThrowError
1 parent 0ae033c commit dd02285

7 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/hooks/__tests__/utils.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ describe('utils', () => {
7878

7979
expect(() =>
8080
getItemAndIndex(undefined, undefined, [1, 2, 3], errorMessage),
81-
).toThrowError(errorMessage)
81+
).toThrow(errorMessage)
8282
})
8383

8484
test('returns index if item is passed', () => {
@@ -137,7 +137,7 @@ describe('utils', () => {
137137
test('renders without error', () => {
138138
expect(() => {
139139
renderHook(() => useMouseAndTouchTracker(undefined, jest.fn(), []))
140-
}).not.toThrowError()
140+
}).not.toThrow()
141141
})
142142

143143
test('adds and removes listeners to environment', () => {

src/hooks/useCombobox/__tests__/getItemProps.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('getItemProps', () => {
1717
test('throws error if no index or item has been passed', () => {
1818
const {result} = renderUseCombobox()
1919

20-
expect(result.current.getItemProps).toThrowError(
20+
expect(result.current.getItemProps).toThrow(
2121
'Pass either item or index to getItemProps!',
2222
)
2323
})

src/hooks/useCombobox/__tests__/utils.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ describe('utils', () => {
44
test('reducer throws error if called without proper action type', () => {
55
expect(() => {
66
reducer({}, {type: 'super-bogus'})
7-
}).toThrowError('Reducer called without proper action type.')
7+
}).toThrow('Reducer called without proper action type.')
88
})
99
})

src/hooks/useMultipleSelection/__tests__/getSelectedItemProps.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('getSelectedItemProps', () => {
1717
test('throws error if no index or item has been passed', () => {
1818
const {result} = renderUseMultipleSelection()
1919

20-
expect(result.current.getSelectedItemProps).toThrowError(
20+
expect(result.current.getSelectedItemProps).toThrow(
2121
'Pass either item or index to getSelectedItemProps!',
2222
)
2323
})

src/hooks/useMultipleSelection/__tests__/utils.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ describe('utils', () => {
44
test('reducer throws error if called without proper action type', () => {
55
expect(() => {
66
reducer({}, {type: 'super-bogus'})
7-
}).toThrowError('Reducer called without proper action type.')
7+
}).toThrow('Reducer called without proper action type.')
88
})
99
})

src/hooks/useSelect/__tests__/getItemProps.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('getItemProps', () => {
1818
test('throws error if no index or item has been passed', () => {
1919
const {result} = renderUseSelect()
2020

21-
expect(result.current.getItemProps).toThrowError(
21+
expect(result.current.getItemProps).toThrow(
2222
'Pass either item or index to getItemProps!',
2323
)
2424
})

src/hooks/useSelect/__tests__/utils.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,5 @@ describe('getItemIndexByCharacterKey', () => {
6060
test('reducer throws error if called without proper action type', () => {
6161
expect(() => {
6262
reducer({}, {type: 'super-bogus'})
63-
}).toThrowError('Reducer called without proper action type.')
63+
}).toThrow('Reducer called without proper action type.')
6464
})

0 commit comments

Comments
 (0)