@ember/test-helpers
Version:
Helpers for testing Ember.js applications
22 lines (18 loc) • 596 B
JavaScript
import { isDescriptor, lookupDescriptorData } from 'dom-element-descriptors';
/**
Used internally by the DOM interaction helpers to get a description of a
target for debug/error messaging.
@private
@param {Target} target the target
@returns {string} a description of the target
*/
function getDescription(target) {
const data = isDescriptor(target) ? lookupDescriptorData(target) : null;
if (data) {
return data.description || '<unknown descriptor>';
} else {
return `${target}`;
}
}
export { getDescription as default };
//# sourceMappingURL=-get-description.js.map