mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-23 17:29:54 +02:00
restore path calculation for grammar test
This commit is contained in:
@@ -4,12 +4,12 @@ import { LALRGenerator } from 'jison';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
const getAbsolutePath = (relativePath: string) => {
|
const getAbsolutePath = (relativePath: string) => {
|
||||||
return new URL(path.join(__dirname, relativePath)).pathname;
|
return new URL(path.join(path.dirname(import.meta.url), relativePath)).pathname;
|
||||||
};
|
};
|
||||||
|
|
||||||
describe('class diagram grammar', function () {
|
describe('class diagram grammar', function () {
|
||||||
it('should have no conflicts', async 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, {});
|
const grammarParser = new LALRGenerator(grammarSource, {});
|
||||||
expect(grammarParser.conflicts).toBe(0);
|
expect(grammarParser.conflicts).toBe(0);
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user