test: fix classDiagramGrammer unit test
The classDiagramGrammer.spec.ts unit test had some bad filepath
manipulation that fails on UNIX platforms.
Instead, we can use the recommended method from the Node.JS
documentation, see https://nodejs.org/api/esm.html#importmetaurl.
Fixes: 221640aa25
This commit is contained in:
parent
7f9ebcf2c6
commit
a1e64c2102
|
@ -1,10 +1,10 @@
|
|||
import { readFile } from 'node:fs/promises';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
// @ts-ignore - no types
|
||||
import { LALRGenerator } from 'jison';
|
||||
import path from 'path';
|
||||
|
||||
const getAbsolutePath = (relativePath: string) => {
|
||||
return new URL(path.join(__dirname, relativePath)).pathname;
|
||||
return fileURLToPath(new URL(relativePath, import.meta.url));
|
||||
};
|
||||
|
||||
describe('class diagram grammar', function () {
|
||||
|
|
Loading…
Reference in New Issue