Skip to content
This repository was archived by the owner on Jul 30, 2020. It is now read-only.

Commit c7348ec

Browse files
author
Brandon Carroll
committed
fix: allow boolean searches for getBy* queries
1 parent ee2dcf1 commit c7348ec

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"dist",
99
"typings",
1010
"cleanup-after-each.js",
11+
"pure.js",
1112
"jest-preset.js"
1213
],
1314
"engines": {
@@ -60,7 +61,7 @@
6061
"react-hooks-testing-library": "^0.5.0",
6162
"react-intl": "^2.8.0",
6263
"react-intl-native": "^2.1.2",
63-
"react-native": "0.59.6",
64+
"react-native": "^0.60.4",
6465
"react-native-gesture-handler": "^1.1.0",
6566
"react-navigation": "^3.5.1",
6667
"react-redux": "^7.0.3",

pure.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// makes it so people can import from '@testing-library/react-native/pure'
2+
module.exports = require('./dist/pure');

src/lib/matches.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function fuzzyMatches(textToMatch, node, matcher, normalizer) {
22
if (typeof textToMatch !== 'string') {
3-
return false;
3+
return textToMatch == matcher;
44
}
55

66
const normalizedText = normalizer(textToMatch);
@@ -15,7 +15,7 @@ function fuzzyMatches(textToMatch, node, matcher, normalizer) {
1515

1616
function matches(textToMatch, node, matcher, normalizer) {
1717
if (typeof textToMatch !== 'string') {
18-
return false;
18+
return textToMatch === matcher;
1919
}
2020

2121
const normalizedText = normalizer(textToMatch);

0 commit comments

Comments
 (0)