Skip to content

Commit 7fd8b61

Browse files
authored
Merge pull request #9 from hypothesis/publish-type-declarations
Emit type declaration files when building library
2 parents 6c5d942 + e3d6a35 commit 7fd8b61

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"version": "1.0.1",
44
"description": "Frontend testing utilities for Hypothesis projects",
55
"type": "module",
6-
"main": "lib/index.js",
6+
"main": "./lib/index.js",
7+
"types": "./lib/index.d.ts",
78
"repository": "https://github.com/hypothesis/frontend-testing",
89
"author": "Hypothesis Developers <eng@list.hypothes.is>",
910
"license": "BSD-2-Clause",

src/accessibility.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ export type Scenario = {
1010
/**
1111
* A function that returns the rendered output to test, or an Enzyme wrapper
1212
* created using Enzyme's `mount` function.
13+
*
14+
* Returning a VNode is preferred. An Enzyme wrapper for a component with a
15+
* top-level Fragment will result in the test being run for the first DOM
16+
* child node only.
17+
* Use the Enzyme wrapper only if really needed, and consider wrapping your
18+
* component with a `<div />` in that case.
1319
*/
1420
content: () => VNode | ReactWrapper;
1521
};

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export type { Scenario } from './accessibility.js';
22
export { checkAccessibility } from './accessibility.js';
33
export { mockImportedComponents } from './mock-imported-components.js';
4+
export type { TestTimeout, TimeoutSpec } from './wait.js';
45
export { delay, waitFor, waitForElement } from './wait.js';

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
/* Emit */
1515
"outDir": "./lib",
16+
"declaration": true,
1617

1718
/* Interop Constraints */
1819
"esModuleInterop": true,

0 commit comments

Comments
 (0)