Fix path in test

This commit is contained in:
Justin Greywolf 2023-05-03 17:01:27 -07:00
parent bf37956528
commit 221640aa25
1 changed files with 2 additions and 2 deletions

View File

@ -4,12 +4,12 @@ import { LALRGenerator } from 'jison';
import path from 'path';
const getAbsolutePath = (relativePath: string) => {
return new URL(path.join(path.dirname(import.meta.url), relativePath)).pathname;
return new URL(path.join(__dirname, relativePath)).pathname;
};
describe('class diagram grammar', function () {
it('should have no conflicts', async function () {
const grammarSource = await readFile(getAbsolutePath('./parser/classDiagram.jison'), 'utf8');
const grammarSource = await readFile(getAbsolutePath('parser/classDiagram.jison'), 'utf8');
const grammarParser = new LALRGenerator(grammarSource, {});
expect(grammarParser.conflicts).toBe(0);
});