Add proper tests, exception handling, implement getAbstractName

This commit is contained in:
John J. Camilleri
2021-10-04 12:10:29 +02:00
parent 314db3ea7f
commit 45db11b669
8 changed files with 3323 additions and 98 deletions

View File

@@ -0,0 +1,16 @@
import PGF from '../index'
test('readPGF successful', () => {
let gr = PGF.readPGF('../haskell/tests/basic.pgf')
})
test('readPGF missing file', () => {
expect(() => {
PGF.readPGF('abc.pgf')
}).toThrow()
})
test('abstract name', () => {
let gr = PGF.readPGF('../haskell/tests/basic.pgf')
expect(gr.getAbstractName()).toBe('basic')
})