How to call frappe.call in frontend (frappe-ui)

I have use frappe.call in frontend for frappe which is created by frappe-ui.
I need frappejs to use frappe.call but in frappe’s project insights (GitHub - frappe/insights: Free and Open Source Data Analytics Tool for your Frappe Apps) they use frappe.call (https://github.com/frappe/insights/blob/b5cf6352c507ba45356dbf3708d3d6a1d1c436e3/frontend/tests/dashboard_page.spec.js#L4) without importing frappejs. How it’s possible?

And doing yarn add frappejs will give error that suggest that some package that need frappejs is running on python 2.x