more unit tests

This commit is contained in:
Klemek
2019-07-12 09:21:18 +02:00
parent 2c23e4227e
commit 513de5dd97
3 changed files with 68 additions and 44 deletions
+25
View File
@@ -0,0 +1,25 @@
/* jshint -W117 */
const faDiagrams = require('../src/index');
test('test fail placing', () => {
const data = {
options: {
'diagonals': false,
},
nodes: [
{name: '1', icon: ''},
{name: '2', icon: ''},
{name: '3', icon: ''},
],
links: [
{from: '1', to: '2', direction: 'left'},
{from: '1', to: '3', direction: 'left'},
]
};
try {
faDiagrams.compute(data);
fail('no error thrown');
} catch (err) {
expect(err).toBe('Failed to place nodes');
}
});