testing-library / native-testing-library

@@ -10,13 +10,13 @@
Loading
10 10
function queryAllByText(
11 11
  container,
12 12
  text,
13 -
  { filter = n => n, exact = true, collapseWhitespace, trim, normalizer } = {},
13 +
  { selector = n => n, exact = true, collapseWhitespace, trim, normalizer } = {},
14 14
) {
15 15
  const matcher = exact ? matches : fuzzyMatches;
16 16
  const matchNormalizer = makeNormalizer({ collapseWhitespace, trim, normalizer });
17 17
18 18
  return Array.from(container.findAll(node => validComponentFilter(node, 'textComponents')))
19 -
    .filter(filter)
19 +
    .filter(selector)
20 20
    .filter(node => matcher(getNodeText(node), node, text, matchNormalizer));
21 21
}
22 22

@@ -50,11 +50,11 @@
Loading
50 50
  'text',
51 51
];
52 52
53 -
function queryAllByRole(container, value, { filter = n => n } = {}) {
53 +
function queryAllByRole(container, value, { selector = n => n } = {}) {
54 54
  const roleElements = container.findAll(c => c.getProp('accessibilityRole'));
55 55
  const traitElements = container.findAll(c => c.getProp('accessibilityTraits'));
56 56
57 -
  return [...roleElements, ...traitElements].filter(filter).filter(node => {
57 +
  return [...roleElements, ...traitElements].filter(selector).filter(node => {
58 58
    const role = node.getProp('accessibilityRole');
59 59
    const traits = node.getProp('accessibilityTraits');
60 60

@@ -9,13 +9,13 @@
Loading
9 9
function queryAllByTitle(
10 10
  container,
11 11
  value,
12 -
  { filter = n => n, exact = true, collapseWhitespace, trim, normalizer } = {},
12 +
  { selector = n => n, exact = true, collapseWhitespace, trim, normalizer } = {},
13 13
) {
14 14
  const matcher = exact ? matches : fuzzyMatches;
15 15
  const matchNormalizer = makeNormalizer({ collapseWhitespace, trim, normalizer });
16 16
17 17
  return Array.from(container.findAll(node => validComponentFilter(node, 'titleComponents')))
18 -
    .filter(filter)
18 +
    .filter(selector)
19 19
    .filter(node => matcher(node.getProp('title'), node, value, matchNormalizer));
20 20
}
21 21

@@ -104,13 +104,13 @@
Loading
104 104
  prop,
105 105
  container,
106 106
  match,
107 -
  { filter = n => n, exact = true, collapseWhitespace, trim, normalizer } = {},
107 +
  { selector = n => n, exact = true, collapseWhitespace, trim, normalizer } = {},
108 108
) {
109 109
  const matcher = exact ? matches : fuzzyMatches;
110 110
  const matchNormalizer = makeNormalizer({ collapseWhitespace, trim, normalizer });
111 111
112 112
  return Array.from(container.findAll(c => c.getProp(prop)))
113 -
    .filter(filter)
113 +
    .filter(selector)
114 114
    .filter(node => {
115 115
      const value = node.getProp(prop);
116 116

@@ -9,13 +9,13 @@
Loading
9 9
function queryAllByDisplayValue(
10 10
  container,
11 11
  value,
12 -
  { filter = n => n, exact = true, collapseWhitespace, trim, normalizer } = {},
12 +
  { selector = n => n, exact = true, collapseWhitespace, trim, normalizer } = {},
13 13
) {
14 14
  const matcher = exact ? matches : fuzzyMatches;
15 15
  const matchNormalizer = makeNormalizer({ collapseWhitespace, trim, normalizer });
16 16
17 17
  return Array.from(container.findAll(node => validComponentFilter(node, 'displayValueComponents')))
18 -
    .filter(filter)
18 +
    .filter(selector)
19 19
    .filter(node => {
20 20
      if (node.type === 'Picker') {
21 21
        return matcher(node.getProp('selectedValue'), node, value, matchNormalizer);
Files Coverage
src/lib 100.00%
Project Totals (20 files) 100.00%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading