@testing-library/dom
Advanced tools
Comparing version 5.5.1 to 5.5.2
@@ -1,2 +0,1 @@ | ||
import jestSerializerAnsi from 'jest-serializer-ansi' | ||
import {getRoles, logRoles, getImplicitAriaRoles} from '../role-helpers' | ||
@@ -135,9 +134,14 @@ import {render, cleanup} from './helpers/test-utils' | ||
test('logRoles logs expected roles for various dom nodes', () => { | ||
expect.addSnapshotSerializer(jestSerializerAnsi) | ||
test('logRoles calls console.log with output from prettyRoles', () => { | ||
const {section} = setup() | ||
const output = logRoles(section) | ||
expect(output).toMatchSnapshot() | ||
jest.spyOn(console, 'log').mockImplementationOnce(() => {}) | ||
logRoles(section) | ||
// eslint-disable-next-line no-console | ||
expect(console.log).toHaveBeenCalledTimes(1) | ||
// eslint-disable-next-line no-console | ||
expect(console.log.mock.calls[0][0]).toMatchSnapshot() | ||
// eslint-disable-next-line no-console | ||
console.log.mockRestore() | ||
}) | ||
@@ -144,0 +148,0 @@ |
@@ -780,3 +780,3 @@ 'use strict'; | ||
var roles = getRoles(container); | ||
return Object.entries(roles).map(function (_ref10) { | ||
var rolesStr = Object.entries(roles).map(function (_ref10) { | ||
var role = _ref10[0], | ||
@@ -789,3 +789,5 @@ elements = _ref10[1]; | ||
return role + ":\n\n" + elementsString + "\n\n" + delimiterBar; | ||
}).join('\n'); | ||
}).join('\n'); // eslint-disable-next-line no-console | ||
console.log(rolesStr); | ||
} | ||
@@ -792,0 +794,0 @@ |
@@ -774,3 +774,3 @@ import _extends from '@babel/runtime/helpers/esm/extends'; | ||
var roles = getRoles(container); | ||
return Object.entries(roles).map(function (_ref10) { | ||
var rolesStr = Object.entries(roles).map(function (_ref10) { | ||
var role = _ref10[0], | ||
@@ -783,3 +783,5 @@ elements = _ref10[1]; | ||
return role + ":\n\n" + elementsString + "\n\n" + delimiterBar; | ||
}).join('\n'); | ||
}).join('\n'); // eslint-disable-next-line no-console | ||
console.log(rolesStr); | ||
} | ||
@@ -786,0 +788,0 @@ |
@@ -88,7 +88,9 @@ "use strict"; | ||
const roles = getRoles(container); | ||
return Object.entries(roles).map(([role, elements]) => { | ||
const rolesStr = Object.entries(roles).map(([role, elements]) => { | ||
const delimiterBar = '-'.repeat(50); | ||
const elementsString = elements.map(el => (0, _queryHelpers.debugDOM)(el.cloneNode(false))).join('\n\n'); | ||
return `${role}:\n\n${elementsString}\n\n${delimiterBar}`; | ||
}).join('\n'); | ||
}).join('\n'); // eslint-disable-next-line no-console | ||
console.log(rolesStr); | ||
} |
{ | ||
"name": "@testing-library/dom", | ||
"version": "5.5.1", | ||
"version": "5.5.2", | ||
"description": "Simple and complete DOM testing utilities that encourage good testing practices.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
1687157
17036
1