Estoy tratando de documentar mi código pero cuando creo una función con el estándar de documento /** */ tengo errores como
promise returned from `findByTestAttr` query must be handledeslinttesting-library/await-async-query)No sé cuál es el problema. ¿Alguien podría explicarme por qué sucede eso?
Aquí está el código.
/** * Returns node(s) with the given data-test attribute. * @param {ShallowWrapper} wrapper - Enzyme shallow wrapper. * @param {string} val - Value of data-test attribute for search. * @returns {ShallowWrapper} */ export const findByTestAttr = (wrapper, val) => { return wrapper.find(`[data-test="${val}"]`); };Y lo estoy llamando aquí:
test("renders without errors", () => { const wrapper = mount(<App />); const appComponent = findByTestAttr(wrapper, "component-app"); expect(appComponent).toHaveLength(1); });