@testing-library/dom
Advanced tools
Comparing version 5.6.0 to 5.6.1
@@ -823,3 +823,12 @@ 'use strict'; | ||
var getMissingError$5 = function (container, role) { | ||
return ("\nUnable to find an element with the role \"" + role + "\"\n\nHere are the available roles:\n\n " + prettyRoles(container).replace(/\n/g, '\n ').replace(/\n\s\s\n/g, '\n\n') + "\n").trim(); | ||
var roles = prettyRoles(container); | ||
var roleMessage; | ||
if (roles.length === 0) { | ||
roleMessage = 'There are no available roles.'; | ||
} else { | ||
roleMessage = ("\nHere are the available roles:\n\n " + roles.replace(/\n/g, '\n ').replace(/\n\s\s\n/g, '\n\n') + "\n").trim(); | ||
} | ||
return ("\nUnable to find an element with the role \"" + role + "\"\n\n" + roleMessage).trim(); | ||
}; | ||
@@ -826,0 +835,0 @@ |
@@ -817,3 +817,12 @@ import _extends from '@babel/runtime/helpers/esm/extends'; | ||
var getMissingError$5 = function (container, role) { | ||
return ("\nUnable to find an element with the role \"" + role + "\"\n\nHere are the available roles:\n\n " + prettyRoles(container).replace(/\n/g, '\n ').replace(/\n\s\s\n/g, '\n\n') + "\n").trim(); | ||
var roles = prettyRoles(container); | ||
var roleMessage; | ||
if (roles.length === 0) { | ||
roleMessage = 'There are no available roles.'; | ||
} else { | ||
roleMessage = ("\nHere are the available roles:\n\n " + roles.replace(/\n/g, '\n ').replace(/\n\s\s\n/g, '\n\n') + "\n").trim(); | ||
} | ||
return ("\nUnable to find an element with the role \"" + role + "\"\n\n" + roleMessage).trim(); | ||
}; | ||
@@ -820,0 +829,0 @@ |
@@ -39,10 +39,22 @@ "use strict"; | ||
const getMissingError = (container, role) => ` | ||
Unable to find an element with the role "${role}" | ||
const getMissingError = (container, role) => { | ||
const roles = (0, _roleHelpers.prettyRoles)(container); | ||
let roleMessage; | ||
if (roles.length === 0) { | ||
roleMessage = 'There are no available roles.'; | ||
} else { | ||
roleMessage = ` | ||
Here are the available roles: | ||
${(0, _roleHelpers.prettyRoles)(container).replace(/\n/g, '\n ').replace(/\n\s\s\n/g, '\n\n')} | ||
${roles.replace(/\n/g, '\n ').replace(/\n\s\s\n/g, '\n\n')} | ||
`.trim(); | ||
} | ||
return ` | ||
Unable to find an element with the role "${role}" | ||
${roleMessage}`.trim(); | ||
}; | ||
const [queryByRole, getAllByRole, getByRole, findAllByRole, findByRole] = (0, _allUtils.buildQueries)(queryAllByRole, getMultipleError, getMissingError); | ||
@@ -49,0 +61,0 @@ exports.findByRole = findByRole; |
{ | ||
"name": "@testing-library/dom", | ||
"version": "5.6.0", | ||
"version": "5.6.1", | ||
"description": "Simple and complete DOM testing utilities that encourage good testing practices.", | ||
@@ -46,3 +46,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@babel/runtime": "^7.4.5", | ||
"@babel/runtime": "^7.5.5", | ||
"@sheerun/mutationobserver-shim": "^0.3.2", | ||
@@ -55,3 +55,3 @@ "aria-query": "3.0.0", | ||
"@testing-library/jest-dom": "^4.0.0", | ||
"dtslint": "^0.8.0", | ||
"dtslint": "^0.9.0", | ||
"jest-in-case": "^1.0.2", | ||
@@ -58,0 +58,0 @@ "jest-serializer-ansi": "^1.0.3", |
@@ -30,3 +30,3 @@ <div align="center"> | ||
[![All Contributors](https://img.shields.io/badge/all_contributors-66-orange.svg?style=flat-square)](#contributors) | ||
[![All Contributors](https://img.shields.io/badge/all_contributors-68-orange.svg?style=flat-square)](#contributors) | ||
[![PRs Welcome][prs-badge]][prs] | ||
@@ -219,2 +219,4 @@ [![Code of Conduct][coc-badge]][coc] | ||
<td align="center"><a href="https://afontcu.dev"><img src="https://avatars0.githubusercontent.com/u/9197791?v=4" width="100px;" alt="Adrià Fontcuberta"/><br /><sub><b>Adrià Fontcuberta</b></sub></a><br /><a href="https://github.com/testing-library/dom-testing-library/commits?author=afontcu" title="Code">💻</a> <a href="https://github.com/testing-library/dom-testing-library/commits?author=afontcu" title="Tests">⚠️</a></td> | ||
<td align="center"><a href="http://thomlom.dev"><img src="https://avatars3.githubusercontent.com/u/16003285?v=4" width="100px;" alt="Thomas Lombart"/><br /><sub><b>Thomas Lombart</b></sub></a><br /><a href="https://github.com/testing-library/dom-testing-library/commits?author=thomlom" title="Code">💻</a></td> | ||
<td align="center"><a href="https://twitter.com/SavePointSam"><img src="https://avatars0.githubusercontent.com/u/8203211?v=4" width="100px;" alt="Sam Horton"/><br /><sub><b>Sam Horton</b></sub></a><br /><a href="https://github.com/testing-library/dom-testing-library/commits?author=SavePointSam" title="Code">💻</a> <a href="https://github.com/testing-library/dom-testing-library/commits?author=SavePointSam" title="Tests">⚠️</a></td> | ||
</tr> | ||
@@ -221,0 +223,0 @@ </table> |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1620129
14920
275
Updated@babel/runtime@^7.5.5