Skip to content

chore(ts): Move typings to DefinitelyTyped, Close #68 #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ This allows you to use all the useful
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->


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

### With TypeScript

Typings are defined under `@testing-library/cypress/typings`, and should be
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love that people won't have to bother with this anymore.

added as follows in `tsconfig.json`:

```json
{
"compilerOptions": {
"types": ["cypress", "../@testing-library/cypress/typings"]
}
}
```

Or if tsconfig.json has a `baseUrl` of `../node_modules` as recommended in
the official Cypress documentation use:
Typings are defined in `@types/testing-library__cypress` at [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/testing-library__cypress),
and should be added as follows in `tsconfig.json`:

```json
{
"compilerOptions": {
"types": ["cypress", "@testing-library/cypress/typings"]
"types": ["cypress", "@types/testing-library__cypress"]
}
}
```
Expand All @@ -113,7 +103,7 @@ You can now use all of `dom-testing-library`'s `getBy`, `getAllBy`, `queryBy`
and `queryAllBy` commands.
[See the `dom-testing-library` docs for reference](https://testing-library.com)

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

To show some simple examples (from
[cypress/integration/commands.spec.js](cypress/integration/commands.spec.js)):
Expand Down
17 changes: 5 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,22 @@
"version": "0.0.0-semantically-released",
"description": "Simple and complete custom Cypress commands and utilities that encourage good testing practices.",
"main": "dist/index.js",
"typings": "typings",
"engines": {
"node": ">=8"
},
"scripts": {
"build": "kcd-scripts build",
"lint": "kcd-scripts lint",
"test": "npm-run-all --parallel test:unit test:cypress test:typings",
"test": "npm-run-all --parallel test:unit test:cypress",
"test:unit": "kcd-scripts test --no-watch",
"test:unit:watch": "kcd-scripts test",
"test:cypress:serve": "serve --listen 13370 ./cypress/fixtures/test-app",
"test:cypress:run": "wait-port --timeout 10000 localhost:13370 && cypress run",
"test:cypress:open": "cypress open",
"test:cypress": "npm-run-all --silent --parallel --race test:cypress:serve test:cypress:run",
"test:cypress:dev": "npm-run-all --silent --parallel --race test:cypress:serve test:cypress:open",
"test:typings": "tsc -p tests/typescript-types/ --noemit",
"test:typings:watch": "tsc -p tests/typescript-types/ --noemit --watch",
"validate": "kcd-scripts validate build,lint,test",
"setup": "npm install && npm run validate -s",
"dtslint": "dtslint typings"
"setup": "npm install && npm run validate -s"
},
"husky": {
"hooks": {
Expand All @@ -31,8 +27,7 @@
},
"files": [
"dist",
"add-commands.js",
"typings"
"add-commands.js"
],
"keywords": [
"testing",
Expand All @@ -48,16 +43,14 @@
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.5.5",
"@testing-library/dom": "^6.0.0"
"@testing-library/dom": "^6.0.0",
"@types/testing-library__cypress": "^4.1.0"
},
"devDependencies": {
"@types/jquery": "*",
"cypress": "3.4.1",
"dtslint": "^0.9.1",
"kcd-scripts": "^1.5.2",
"npm-run-all": "^4.1.2",
"serve": "^11.1.0",
"typescript": "^3.5.3",
"wait-port": "^0.2.2"
},
"peerDependencies": {
Expand Down
47 changes: 0 additions & 47 deletions tests/typescript-types/test.spec.ts

This file was deleted.

14 changes: 0 additions & 14 deletions tests/typescript-types/tsconfig.json

This file was deleted.

Loading