2
0
mirror of https://github.com/Ionaru/easy-markdown-editor synced 2025-06-27 13:11:01 -06:00

16 lines
396 B
JavaScript
Raw Normal View History

2022-01-14 22:27:43 +01:00
/// <reference types="cypress" />
const unquote = (str) => str.replace(/(^")|("$)/g, '');
Cypress.Commands.add(
'before',
{
prevSubject: 'element',
},
(element, property) => {
const win = element[0].ownerDocument.defaultView;
const before = win.getComputedStyle(element[0], 'before');
return unquote(before.getPropertyValue(property));
},
);