-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.d.ts
More file actions
44 lines (37 loc) · 1.05 KB
/
index.d.ts
File metadata and controls
44 lines (37 loc) · 1.05 KB
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
38
39
40
41
42
43
44
import Component from 'marko/src/components/Component';
export interface RenderResult {
container: HTMLElement
/**
* Component instance
*/
component: Component
getNodes: () => HTMLElement[]
}
export interface InitResult {
/**
* Component class, exposed so we could spy or mock on Marko component methods.
* You can access Marko component static properties & methods through its prototype,
* e.g `componentClass.prototype.onMount`
*/
componentClass: Component,
/**
* Render & mount Marko component inside a test container, which is
* appended to document.body.
* It should be used with cleanup.
*/
render: (input: any) => Promise<RenderResult>
}
/**
* Init testing util with the given Marko component
*
* @param componentFullPath Full path to your Marko component
*
* @example
*
* const { render, cleanup } = init(path.resolve(__dirname, '../index.marko'));
*/
export function init(componentFullPath: string): InitResult
/**
* Unmounts test container that were mounted with render()
*/
export function cleanup(): void