mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-17 06:20:07 +02:00
Added logger for dealing with issue #179
Added markdown files for the documentation. parseError exposed from the mermaidAPI
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
* Created by knut on 14-11-23.
|
||||
*/
|
||||
var api = require('./mermaidAPI.js');
|
||||
var log = require('./logger').create();
|
||||
|
||||
describe('when using mermaidAPI and ',function() {
|
||||
describe('doing initialize ',function() {
|
||||
@@ -52,4 +53,20 @@ describe('when using mermaidAPI and ',function() {
|
||||
});
|
||||
|
||||
});
|
||||
describe('checking validity of input ', function(){
|
||||
it('it should return false for an invalid definiton',function(){
|
||||
spyOn(global.mermaidAPI,'parseError');
|
||||
var res = api.parse('this is not a mermaid diagram definition');
|
||||
|
||||
expect(res).toBe(false);
|
||||
expect(global.mermaidAPI.parseError).toHaveBeenCalled();
|
||||
});
|
||||
it('it should return true for a valid definiton',function(){
|
||||
spyOn(global.mermaidAPI,'parseError');
|
||||
var res = mermaid.parse('graph TD;A--x|text including URL space|B;');
|
||||
|
||||
expect(res).toBe(true);
|
||||
expect(global.mermaidAPI.parseError).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user