Skip to content

Commit

Permalink
Restore commented test
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerlong committed Sep 9, 2017
1 parent 8c2690e commit ab69dac
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions src/mermaid.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,19 +289,23 @@ describe('when using mermaid and ', function () {
expect(global.mermaid.parseError).not.toHaveBeenCalled()
})

// todo: the following code was commented out, because digraph emits parseError infinitely
// I think it's a bug of the digraph

// it('it should return false for an invalid dot definition', function () {
// spyOn(global.mermaid, 'parseError')
// var res = mermaid.parse('digraph\n' +
// '{\n' +
// 'a -:> b -> c -- d -> e;\n' +
// 'a -- e;\n' +
// '}')

// expect(res).toBe(false)
// expect(global.mermaid.parseError).toHaveBeenCalled()
// })
it('it should return false for an invalid dot definition', function () {
const foo = {
parseError: () => {
}
}
spyOn(foo, 'parseError')
mermaid.eventEmitter.on('parseError', (err, hash) => {
foo.parseError(err)
})
var res = mermaid.parse('digraph\n' +
'{\n' +
'a -:> b -> c -- d -> e;\n' +
'a -- e;\n' +
'}')

expect(res).toBe(false)
expect(foo.parseError).toHaveBeenCalled()
})
})
})

0 comments on commit ab69dac

Please sign in to comment.