Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
HI! PLEASE STOP TO READ THIS!! If you're issue is regarding one of the query
HI! PLEASE STOP TO READ THIS!! If your issue is regarding one of the query
APIs (`getByText`, `getByLabelText`, etc), then please file it on the
https://github.com/kentcdodds/dom-testing-library repository instead. If you
file it here it will be closed. Thanks :)
Expand All @@ -23,6 +23,7 @@ learn how: http://kcd.im/pull-request
Relevant code or config

```javascript

```

What you did:
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ 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)
- [Intellisense for JavaScript with VS Code](#intellisense-for-javascript-with-vs-code)
Expand Down Expand Up @@ -148,8 +147,11 @@ expects DOM nodes. When you chain a query, it will get the first DOM node from
`subject` of the collection and use that as the `container` parameter for the
`DOM Testing Library` functions.

`get*` and `query*` queries are disabled. `find*` queries do not use the Promise
API of `DOM Testing Library`, but instead forward to the `get*` queries and use
`query*` queries are not supported. You should use the `should('not.exist')
assertion instead to check for the absence of an element.

`get*` queries are disabled. `find*` queries do not use the Promise API of
`DOM Testing Library`, but instead forward to the `get*` queries and use
Cypress' built-in retryability using error messages from `get*` APIs to forward
as error messages if a query fails.

Expand Down
50 changes: 0 additions & 50 deletions cypress/integration/query.spec.js

This file was deleted.

4 changes: 3 additions & 1 deletion src/__tests__/commands.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import {queries} from '@testing-library/dom'
import {commands} from '../'

const queryNames = Object.keys(queries).filter(q => /^(find|get)/.test(q))

test('exports expected commands', () => {
expect(commands).toMatchObject(expect.any(Array))
const sortedQueryNames = Object.keys(queries).sort()
const sortedQueryNames = queryNames.sort()
const sortedCommandNames = commands.map(({name}) => name).sort()
expect(sortedCommandNames).toEqual(sortedQueryNames)
commands.forEach(command =>
Expand Down
7 changes: 4 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ function configure({fallbackRetryWithoutPreviousSubject, ...config}) {
return configureDTL(config)
}

const queryNames = Object.keys(queries)

const deprecatedRegex = /^(get|query)/
const availableRegex = /^(find|get)/
const deprecatedRegex = /^(get)/
Copy link
Member

Choose a reason for hiding this comment

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

Let's just get rid of all deprecated stuff in this release 👍

const findRegex = /^find/

const queryNames = Object.keys(queries).filter(q => availableRegex.test(q))

const deprecatedQueryNames = queryNames.filter(q => deprecatedRegex.test(q))
const findQueryNames = queryNames.filter(q => findRegex.test(q))

Expand Down