@qntm-code/utils
Version:
A collection of useful utility functions with associated TypeScript types. All functions have been unit tested.
14 lines (13 loc) • 466 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const __1 = require("..");
describe('getAncestors', () => {
it('should get ancestors for a given element', () => {
const a = document.createElement('div');
const b = document.createElement('p');
const c = document.createElement('strong');
b.appendChild(c);
a.appendChild(b);
expect((0, __1.getAncestors)(c)).toEqual([b, a]);
});
});