Skip to content

Commit c0059e3

Browse files
simjesKent C. Dodds
authored and
Kent C. Dodds
committed
fix(TS): move typings to DefinitelyTyped (#69)
closes #68
1 parent 5f282c7 commit c0059e3

File tree

7 files changed

+10
-847
lines changed

7 files changed

+10
-847
lines changed

README.md

+5-15
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ This allows you to use all the useful
5757
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
5858
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
5959

60+
6061
- [Installation](#installation)
6162
- [With TypeScript](#with-typescript)
6263
- [Usage](#usage)
@@ -77,24 +78,13 @@ npm install --save-dev @testing-library/cypress
7778

7879
### With TypeScript
7980

80-
Typings are defined under `@testing-library/cypress/typings`, and should be
81-
added as follows in `tsconfig.json`:
82-
83-
```json
84-
{
85-
"compilerOptions": {
86-
"types": ["cypress", "../@testing-library/cypress/typings"]
87-
}
88-
}
89-
```
90-
91-
Or if tsconfig.json has a `baseUrl` of `../node_modules` as recommended in
92-
the official Cypress documentation use:
81+
Typings are defined in `@types/testing-library__cypress` at [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/testing-library__cypress),
82+
and should be added as follows in `tsconfig.json`:
9383

9484
```json
9585
{
9686
"compilerOptions": {
97-
"types": ["cypress", "@testing-library/cypress/typings"]
87+
"types": ["cypress", "@types/testing-library__cypress"]
9888
}
9989
}
10090
```
@@ -113,7 +103,7 @@ You can now use all of `dom-testing-library`'s `getBy`, `getAllBy`, `queryBy`
113103
and `queryAllBy` commands.
114104
[See the `dom-testing-library` docs for reference](https://testing-library.com)
115105

116-
You can find [all Library definitions here](./typings/index.d.ts).
106+
You can find [all Library definitions here](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/testing-library__cypress/index.d.ts).
117107

118108
To show some simple examples (from
119109
[cypress/integration/commands.spec.js](cypress/integration/commands.spec.js)):

package.json

+5-12
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,22 @@
33
"version": "0.0.0-semantically-released",
44
"description": "Simple and complete custom Cypress commands and utilities that encourage good testing practices.",
55
"main": "dist/index.js",
6-
"typings": "typings",
76
"engines": {
87
"node": ">=8"
98
},
109
"scripts": {
1110
"build": "kcd-scripts build",
1211
"lint": "kcd-scripts lint",
13-
"test": "npm-run-all --parallel test:unit test:cypress test:typings",
12+
"test": "npm-run-all --parallel test:unit test:cypress",
1413
"test:unit": "kcd-scripts test --no-watch",
1514
"test:unit:watch": "kcd-scripts test",
1615
"test:cypress:serve": "serve --listen 13370 ./cypress/fixtures/test-app",
1716
"test:cypress:run": "wait-port --timeout 10000 localhost:13370 && cypress run",
1817
"test:cypress:open": "cypress open",
1918
"test:cypress": "npm-run-all --silent --parallel --race test:cypress:serve test:cypress:run",
2019
"test:cypress:dev": "npm-run-all --silent --parallel --race test:cypress:serve test:cypress:open",
21-
"test:typings": "tsc -p tests/typescript-types/ --noemit",
22-
"test:typings:watch": "tsc -p tests/typescript-types/ --noemit --watch",
2320
"validate": "kcd-scripts validate build,lint,test",
24-
"setup": "npm install && npm run validate -s",
25-
"dtslint": "dtslint typings"
21+
"setup": "npm install && npm run validate -s"
2622
},
2723
"husky": {
2824
"hooks": {
@@ -31,8 +27,7 @@
3127
},
3228
"files": [
3329
"dist",
34-
"add-commands.js",
35-
"typings"
30+
"add-commands.js"
3631
],
3732
"keywords": [
3833
"testing",
@@ -48,16 +43,14 @@
4843
"license": "MIT",
4944
"dependencies": {
5045
"@babel/runtime": "^7.5.5",
51-
"@testing-library/dom": "^6.0.0"
46+
"@testing-library/dom": "^6.0.0",
47+
"@types/testing-library__cypress": "^4.1.0"
5248
},
5349
"devDependencies": {
54-
"@types/jquery": "*",
5550
"cypress": "3.4.1",
56-
"dtslint": "^0.9.1",
5751
"kcd-scripts": "^1.5.2",
5852
"npm-run-all": "^4.1.2",
5953
"serve": "^11.1.0",
60-
"typescript": "^3.5.3",
6154
"wait-port": "^0.2.2"
6255
},
6356
"peerDependencies": {

tests/typescript-types/test.spec.ts

-47
This file was deleted.

tests/typescript-types/tsconfig.json

-14
This file was deleted.

0 commit comments

Comments
 (0)