mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-11 05:49:31 -06:00
Add proper tests, exception handling, implement getAbstractName
This commit is contained in:
16
src/runtime/javascript/tests/basic.test.ts
Normal file
16
src/runtime/javascript/tests/basic.test.ts
Normal 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')
|
||||
})
|
||||
@@ -1,3 +0,0 @@
|
||||
import PGF from '../index'
|
||||
|
||||
PGF.readPGF('../haskell/tests/basic.pgf')
|
||||
Reference in New Issue
Block a user