resolve db import in info.spec.ts

This commit is contained in:
Yokozuna59 2023-06-14 22:23:31 +03:00
parent d6bd59c46e
commit bf346ea155

View File

@ -1,10 +1,10 @@
// @ts-ignore - jison doesn't export types // @ts-ignore - jison doesn't export types
import { parser } from './parser/info.jison'; import { parser } from './parser/info.jison';
import infoDb from './infoDb.js'; import { db } from './infoDb.js';
describe('info graph', () => { describe('info graph', () => {
beforeEach(() => { beforeEach(() => {
parser.yy = infoDb; parser.yy = db;
parser.yy.clear(); parser.yy.clear();
}); });
@ -12,13 +12,13 @@ describe('info graph', () => {
const str = `info`; const str = `info`;
parser.parse(str); parser.parse(str);
expect(infoDb.getInfo()).toBeFalsy(); expect(db.getInfo()).toBeFalsy();
}); });
it('should handle an info definition with showInfo', () => { it('should handle an info definition with showInfo', () => {
const str = `info showInfo`; const str = `info showInfo`;
parser.parse(str); parser.parse(str);
expect(infoDb.getInfo()).toBeTruthy(); expect(db.getInfo()).toBeTruthy();
}); });
}); });