act-rules / act-rules-web

Source for ACT Rules website
https://act-rules.github.io/
Other
3 stars 5 forks source link

refactor: update creating testcase's to use markdownAST #92

Closed jeeyyy closed 4 years ago

jeeyyy commented 4 years ago

Update createTestcases npm script to parse markdown files using remark and use the markdown syntax tree to grab code snippets, than relying on regex.

This is a step in the right direction over using regular expressions.

jeeyyy commented 4 years ago

@Jym77 FYI - when visiting the ast for heading we get all depths. We have tests in the other repo where we ensure test case headings are named correctly and of the right depth. So we should be good here to just filter by a desired depth.

Jym77 commented 4 years ago

@Jym77 FYI - when visiting the ast for heading we get all depths. We have tests in the other repo where we ensure test case headings are named correctly and of the right depth. So we should be good here to just filter by a desired depth.

There will be a problem if something else than a test case has a heading depth of 4 (it will then be wrongly treated as an example).