mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-16 13:59:54 +02:00
#926 Adding e2e tools for replicating issues
This commit is contained in:
22
.tern-project
Normal file
22
.tern-project
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"ecmaVersion": 6,
|
||||||
|
"libs": [
|
||||||
|
"browser"
|
||||||
|
],
|
||||||
|
"loadEagerly": [
|
||||||
|
"path/to/your/js/**/*.js"
|
||||||
|
],
|
||||||
|
"dontLoad": [
|
||||||
|
"node_modules/**",
|
||||||
|
"path/to/your/js/**/*.js"
|
||||||
|
],
|
||||||
|
"plugins": {
|
||||||
|
"modules": {},
|
||||||
|
"es_modules": {},
|
||||||
|
"node": {},
|
||||||
|
"doc_comment": {
|
||||||
|
"fullDocs": true,
|
||||||
|
"strong": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -6,4 +6,29 @@ Apart from beeing rendered in a browser the tests perform image snapshots of the
|
|||||||
|
|
||||||
## To run the tests
|
## To run the tests
|
||||||
1. Start the dev server by running ***yarn dev***
|
1. Start the dev server by running ***yarn dev***
|
||||||
2. Run yarn e2e to run the tests
|
2. Run yarn e2e to run the tests
|
||||||
|
|
||||||
|
## Recomended way of working
|
||||||
|
|
||||||
|
If you are working with an issue you wanto to fix. Start with making a e2e test that show the issue.
|
||||||
|
|
||||||
|
Add otions for the e2e tests to log the dev server url as in the example below.
|
||||||
|
|
||||||
|
```
|
||||||
|
await imgSnapshotTest(page, `
|
||||||
|
graph LR
|
||||||
|
foo-->bar
|
||||||
|
|
||||||
|
style foo fill:#F99,stroke-width:2px,stroke:#F0F
|
||||||
|
style bar fill:#999,color: #ffffff, stroke-width:10px,stroke:#0F0
|
||||||
|
`,
|
||||||
|
{
|
||||||
|
listUrl: true,
|
||||||
|
listId: 'color'
|
||||||
|
logLevel: 0
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
Open the url in the dev server and fix the issue.
|
||||||
|
|
||||||
|
This way if working makes it easy to have render a graph you want to work with ands ensures that the e2e suit is expanded.
|
@@ -12,6 +12,10 @@ export const mermaidUrl = (graphStr, options, api) => {
|
|||||||
url = 'http://localhost:9000/xss.html?graph=' + graphStr
|
url = 'http://localhost:9000/xss.html?graph=' + graphStr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.listUrl) {
|
||||||
|
console.log(options.listId, ' ', url)
|
||||||
|
}
|
||||||
|
|
||||||
return url
|
return url
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user