mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-26 15:44:12 +01:00
Import at the top
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import diagram from './sankey-arrow.jison';
|
import diagram from './sankey-arrow.jison';
|
||||||
import { parser } from './sankey-arrow.jison';
|
import { parser } from './sankey-arrow.jison';
|
||||||
import db from '../sankeyDB.js';
|
import db from '../sankeyDB.js';
|
||||||
// import { fail } from 'assert';
|
|
||||||
|
|
||||||
describe('sankey-beta diagram', function () {
|
describe('sankey-beta diagram', function () {
|
||||||
// TODO - these examples should be put into ./parser/stateDiagram.spec.js
|
// TODO - these examples should be put into ./parser/stateDiagram.spec.js
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import { parser } from './sankey.jison';
|
|||||||
import db from '../sankeyDB.js';
|
import db from '../sankeyDB.js';
|
||||||
import { cleanupComments } from '../../../diagram-api/comments.js';
|
import { cleanupComments } from '../../../diagram-api/comments.js';
|
||||||
import { prepareTextForParsing } from '../sankeyUtils.js';
|
import { prepareTextForParsing } from '../sankeyUtils.js';
|
||||||
|
import * as fs from 'fs';
|
||||||
|
import * as path from 'path';
|
||||||
|
|
||||||
describe('Sankey diagram', function () {
|
describe('Sankey diagram', function () {
|
||||||
describe('when parsing an info graph it', function () {
|
describe('when parsing an info graph it', function () {
|
||||||
@@ -15,8 +17,6 @@ describe('Sankey diagram', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('parses csv', async () => {
|
it('parses csv', async () => {
|
||||||
const fs = await import('fs');
|
|
||||||
const path = await import('path');
|
|
||||||
const csv = path.resolve(__dirname, './energy.csv');
|
const csv = path.resolve(__dirname, './energy.csv');
|
||||||
const data = fs.readFileSync(csv, 'utf8');
|
const data = fs.readFileSync(csv, 'utf8');
|
||||||
const graphDefinition = prepareTextForParsing(cleanupComments('sankey-beta\n\n ' + data));
|
const graphDefinition = prepareTextForParsing(cleanupComments('sankey-beta\n\n ' + data));
|
||||||
|
|||||||
Reference in New Issue
Block a user