-
Notifications
You must be signed in to change notification settings - Fork 0
/
markdown.d.ts
35 lines (32 loc) · 1.21 KB
/
markdown.d.ts
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
import type { FeatureApi } from "./cypress";
/**
* Parse markdown content string and create a feature from it.
* The structure of markdown file is following:
* # Feature title
* Optional paragraph or multiple paragraphs of feature description, may contain links
*
* ## Category
* - list of requirements
*
* @param {string} markdown String of markdown content
*/
export declare const parseMarkdownFeature: (markdown: string) => FeatureApi;
/**
* Since it uses cy.readFile(), it can be executed only within cypress hooks like before().
*
* @param {string} path Path to markdown file from feature root
*/
export declare const createFeatureFromMarkdown: (path: string) => {
// Cypress.Chainable<FeatureApi>
then: (callback: (FeatureApi: FeatureApi) => void) => void;
};
/**
* It immediately returns empty feature and creates a before() hook which reads markdown file.
* Once markdown has been read, its content(title, description, structure) merged
* with returned feature.
*
* This way we don't need to wait for a promise or wrap it into lifecycle hooks.
*
* @param {string} path Path to markdown file from feature root
*/
export declare const createFeatureFromMarkdownAsync: (path: string) => FeatureApi;