-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.mjs
More file actions
37 lines (30 loc) · 841 Bytes
/
index.mjs
File metadata and controls
37 lines (30 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { getContainerEl, setupHooks } from '@cypress/mount-utils'
let dispose
function cleanup() {
dispose?.()
}
/**
* @param {Object} config
* @param {Object} options={}
*/
export function mount(config, options={}) {
// Retrieve root DOM element that Cypress has prepared for this test
const root = getContainerEl(),
rootId = root.id
console.log(rootId);
console.log(root);
dispose = () => {
console.log(rootId)
}
// Wait until next requestAnimationFrame to ensure any async render logic has executed
return cy.wait(50, { log: false }).then(() => {
if (options.log !== false) {
Cypress.log({
name : 'mount',
message: 'Mounted component'
})
}
})
}
// Cleanup between each test
setupHooks(cleanup)