Skip to content
This repository was archived by the owner on Dec 30, 2022. It is now read-only.

Commit a863430

Browse files
authored
fix(types): export correct types for react-instantsearch-hooks-web (#3454)
* fix(types): export correct types for react-instantsearch-hooks-web The reason the types previously were the wrong directory is because `__testutils/all-widgets.ts` was included, and this imported items from the root, thus changing the output format of the types. * refactor: move utils file into test make sure it's ignored using jest instead of typescript
1 parent 719b6ab commit a863430

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

jest.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ module.exports = {
33
'@testing-library/jest-dom/extend-expect',
44
'./scripts/jest/setupTests.ts',
55
],
6-
testPathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/examples/'],
6+
testPathIgnorePatterns: [
7+
'<rootDir>/node_modules/',
8+
'<rootDir>/examples/',
9+
'/__utils__/',
10+
],
711
snapshotSerializers: ['enzyme-to-json/serializer'],
812
testEnvironment: 'jsdom',
913
watchPlugins: [

packages/react-instantsearch-hooks-web/src/widgets/__testutils__/all-widgets.tsx renamed to packages/react-instantsearch-hooks-web/src/widgets/__tests__/__utils__/all-widgets.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import {
55
InstantSearchServerContext,
66
} from 'react-instantsearch-hooks';
77

8-
import * as widgets from '../';
9-
import { createSearchClient } from '../../../../../test/mock';
8+
import * as widgets from '../..';
9+
import { createSearchClient } from '../../../../../../test/mock';
1010

1111
import type { InstantSearch as InstantSearchClass } from 'instantsearch.js';
1212
import type { ComponentProps } from 'react';

packages/react-instantsearch-hooks-web/src/widgets/__tests__/all-components.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import { render } from '@testing-library/react';
55
import React from 'react';
66

7-
import { getAllWidgets } from '../__testutils__/all-widgets';
7+
import { getAllWidgets } from './__utils__/all-widgets';
88

99
describe('rendering', () => {
1010
const widgets = getAllWidgets();

packages/react-instantsearch-hooks-web/src/widgets/__tests__/all-widgets.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @jest-environment node
33
*/
44

5-
import { getAllInstantSearchWidgets } from '../__testutils__/all-widgets';
5+
import { getAllInstantSearchWidgets } from './__utils__/all-widgets';
66

77
describe('widgets', () => {
88
const widgets = getAllInstantSearchWidgets();

tsconfig.declaration.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"emitDeclarationOnly": true,
66
"noEmit": false
77
},
8-
"exclude": ["**/__tests__/**/*", "**/dist/**/*"]
8+
"exclude": ["**/__tests__/**/*", "**/dist/**/*"],
99
}

0 commit comments

Comments
 (0)