mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 22:19:40 -08:00
043a2954f8
* create lezer-promql module + move codemirror to a pure esm module + unified dependencies Signed-off-by: Augustin Husson <[email protected]> * ignore test utils file and remove the type "module" in package.json Signed-off-by: Augustin Husson <[email protected]> * use jest to run the lezer-promql test Signed-off-by: Augustin Husson <[email protected]> * give an automatic way to update the ui dependencies Signed-off-by: Augustin Husson <[email protected]> * update all dependencies using make update-npm-deps Signed-off-by: Augustin Husson <[email protected]> * fix react-app test Signed-off-by: Augustin Husson <[email protected]> * remove generated file Signed-off-by: Augustin Husson <[email protected]> * remove unnecessary backslash in script Signed-off-by: Augustin Husson <[email protected]> * fix reviews Signed-off-by: Augustin Husson <[email protected]> * rewording Signed-off-by: Augustin Husson <[email protected]> * use npx to run lezer-generator Signed-off-by: Augustin Husson <[email protected]>
17 lines
554 B
JavaScript
17 lines
554 B
JavaScript
import { parser } from '../dist/index.es.js';
|
|
import { fileTests } from '@lezer/generator/dist/test';
|
|
|
|
import * as fs from 'fs';
|
|
import * as path from 'path';
|
|
import { fileURLToPath } from 'url';
|
|
|
|
let caseDir = path.dirname(fileURLToPath(import.meta.url))
|
|
for (const file of fs.readdirSync(caseDir)) {
|
|
if (!/\.txt$/.test(file)) continue;
|
|
|
|
const name = /^[^.]*/.exec(file)[0];
|
|
describe(name, () => {
|
|
for (const { name, run } of fileTests(fs.readFileSync(path.join(caseDir, file), 'utf8'), file)) it(name, () => run(parser));
|
|
});
|
|
}
|