diff --git a/README.md b/README.md index 55c481c..4357b90 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ This allows you to use all the useful + - [Installation](#installation) - [With TypeScript](#with-typescript) - [Usage](#usage) @@ -77,24 +78,13 @@ npm install --save-dev @testing-library/cypress ### With TypeScript -Typings are defined under `@testing-library/cypress/typings`, and should be -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"] } } ``` @@ -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)): diff --git a/package.json b/package.json index 2a7239f..80072f2 100644 --- a/package.json +++ b/package.json @@ -3,14 +3,13 @@ "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", @@ -18,11 +17,8 @@ "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": { @@ -31,8 +27,7 @@ }, "files": [ "dist", - "add-commands.js", - "typings" + "add-commands.js" ], "keywords": [ "testing", @@ -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": { diff --git a/tests/typescript-types/test.spec.ts b/tests/typescript-types/test.spec.ts deleted file mode 100644 index 585cda1..0000000 --- a/tests/typescript-types/test.spec.ts +++ /dev/null @@ -1,47 +0,0 @@ -test('includes proper TypeScript types', () => { - cy.visit('#/foo') - - cy.getByLabelText('foo').should($elements => { - expect($elements.length).to.eq(0) - expect($elements[0].tagName).to.eq(0) - }) - - cy.getAllByPlaceholderText('foo').should($elements => { - expect($elements.length).to.eq(0) - expect($elements[0].tagName).to.eq(0) - }) - - // With regex - cy.queryByPlaceholderText<'a'>(/foo/).should($element => { - const element = $element.get(0) - - if (element) { - expect(element.href).to.eq('') - } - }) - - // With matcher function - const matcherFn = (content: string, $element: HTMLElement) => true - - cy.queryByPlaceholderText(matcherFn).should($element => { - const element = $element.get(0) - - if (element) { - expect(element.play).to.exist - } - }) - - // With matcher options - cy.queryAllByPlaceholderText('foo', { - collapseWhitespace: true, - exact: true, - timeout: 500, - trim: true, - }).should($elements => { - const element = $elements[0] - - if (element) { - expect(element.play).to.exist - } - }) -}) diff --git a/tests/typescript-types/tsconfig.json b/tests/typescript-types/tsconfig.json deleted file mode 100644 index ee06bad..0000000 --- a/tests/typescript-types/tsconfig.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "compilerOptions": { - "lib": ["dom", "es2015", "es2016", "es2017"], - "target": "es2017", - "module": "esnext", - "moduleResolution": "node", - "experimentalDecorators": true, - "outDir": "dist", - "noUnusedLocals": true, - "noImplicitAny": true, - "strictNullChecks": true, - "types": ["cypress", "../../typings"] - } -} diff --git a/typings/index.d.ts b/typings/index.d.ts deleted file mode 100644 index 29c3a55..0000000 --- a/typings/index.d.ts +++ /dev/null @@ -1,738 +0,0 @@ -// TypeScript Version: 2.8 - -import { Matcher, MatcherOptions as DTLMatcherOptions, SelectorMatcherOptions as DTLSelectorMatcherOptions } from '@testing-library/dom'; - -export interface CTLMatcherOptions { - timeout?: number -} - -export type MatcherOptions = DTLMatcherOptions | CTLMatcherOptions -export type SelectorMatcherOptions = - | DTLSelectorMatcherOptions - | CTLMatcherOptions - -declare global { - namespace Cypress { - interface Chainable { - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - queryByPlaceholderText( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - queryByPlaceholderText( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - queryAllByPlaceholderText( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - queryAllByPlaceholderText( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - getByPlaceholderText( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - getByPlaceholderText( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - getAllByPlaceholderText( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - getAllByPlaceholderText( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - queryBySelectText( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - queryBySelectText( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - queryAllBySelectText( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - queryAllBySelectText( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - getBySelectText( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - getBySelectText( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - getAllBySelectText( - id: Matcher, - options?: MatcherOptions, - ): Chainable - getAllBySelectText( - id: Matcher, - options?: MatcherOptions, - ): Chainable - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - queryByText( - id: Matcher, - options?: SelectorMatcherOptions, - ): Chainable> - queryByText( - id: Matcher, - options?: SelectorMatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - queryAllByText( - id: Matcher, - options?: SelectorMatcherOptions, - ): Chainable> - queryAllByText( - id: Matcher, - options?: SelectorMatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - getByText( - id: Matcher, - options?: SelectorMatcherOptions, - ): Chainable> - getByText( - id: Matcher, - options?: SelectorMatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - getAllByText( - id: Matcher, - options?: SelectorMatcherOptions, - ): Chainable - getAllByText( - id: Matcher, - options?: SelectorMatcherOptions, - ): Chainable - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - queryByLabelText( - id: Matcher, - options?: SelectorMatcherOptions, - ): Chainable> - queryByLabelText( - id: Matcher, - options?: SelectorMatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - queryAllByLabelText( - id: Matcher, - options?: SelectorMatcherOptions, - ): Chainable> - queryAllByLabelText( - id: Matcher, - options?: SelectorMatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - getByLabelText( - id: Matcher, - options?: SelectorMatcherOptions, - ): Chainable> - getByLabelText( - id: Matcher, - options?: SelectorMatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - getAllByLabelText( - id: Matcher, - options?: SelectorMatcherOptions, - ): Chainable - getAllByLabelText( - id: Matcher, - options?: SelectorMatcherOptions, - ): Chainable - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - queryByAltText( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - queryByAltText( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - queryAllByAltText( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - queryAllByAltText( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - getByAltText( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - getByAltText( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - getAllByAltText( - id: Matcher, - options?: MatcherOptions, - ): Chainable - getAllByAltText( - id: Matcher, - options?: MatcherOptions, - ): Chainable - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - queryByTestId( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - queryByTestId( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - queryAllByTestId( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - queryAllByTestId( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - getByTestId( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - getByTestId( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - getAllByTestId( - id: Matcher, - options?: MatcherOptions, - ): Chainable - getAllByTestId( - id: Matcher, - options?: MatcherOptions, - ): Chainable - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - queryByTitle( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - queryByTitle( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - queryAllByTitle( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - queryAllByTitle( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - getByTitle( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - getByTitle( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - getAllByTitle( - id: Matcher, - options?: MatcherOptions, - ): Chainable - getAllByTitle( - id: Matcher, - options?: MatcherOptions, - ): Chainable - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - queryByDisplayValue( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - queryByDisplayValue( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - queryAllByDisplayValue( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - queryAllByDisplayValue( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - getByDisplayValue( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - getByDisplayValue( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - getAllByDisplayValue( - id: Matcher, - options?: MatcherOptions, - ): Chainable - getAllByDisplayValue( - id: Matcher, - options?: MatcherOptions, - ): Chainable - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - queryByRole( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - queryByRole( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - queryAllByRole( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - queryAllByRole( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - getByRole( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - getByRole( - id: Matcher, - options?: MatcherOptions, - ): Chainable> - - /** - * dom-testing-library helpers for Cypress - * - * `getBy*` APIs search for an element and throw an error if nothing found - * `getAllBy*` APIs search for all elements and an error if nothing found - * `queryBy*` APIs search for an element and returns null if nothing found - * `queryAllBy*` APIs search for all elements and return empty array if nothing found - * - * @see https://github.com/testing-library/cypress-testing-library#usage - * @see https://github.com/testing-library/dom-testing-library#table-of-contents - */ - getAllByRole( - id: Matcher, - options?: MatcherOptions, - ): Chainable - getAllByRole( - id: Matcher, - options?: MatcherOptions, - ): Chainable - } - } -} diff --git a/typings/tsconfig.json b/typings/tsconfig.json deleted file mode 100644 index 167a719..0000000 --- a/typings/tsconfig.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": ["es6", "dom"], - "noImplicitAny": true, - "noImplicitThis": true, - "strictFunctionTypes": true, - "strictNullChecks": true, - "noEmit": true, - - "baseUrl": ".", - "paths": {"cypress-testing-library": ["."]} - } -} diff --git a/typings/tslint.json b/typings/tslint.json deleted file mode 100644 index 286a004..0000000 --- a/typings/tslint.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "dtslint/dtslint.json", - "rules": { - "semicolon": [true, "never"], - "whitespace": [false] - } -}