feat(editor): Migrate codemirror-lang-n8n-expression into this monorepo (no-changelog) (#9087)

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-05-10 18:49:22 +02:00
committed by GitHub
parent aa397b9730
commit 244520547b
19 changed files with 499 additions and 43 deletions

View File

@@ -0,0 +1,21 @@
import fs from 'fs';
import path from 'path';
import { fileTests as runTestFile } from '@lezer/generator/dist/test';
import { n8nLanguage } from '../../src/expressions/index';
describe('expressions language', () => {
const CASES_DIR = __dirname;
for (const testFile of fs.readdirSync(CASES_DIR)) {
if (!/\.txt$/.test(testFile)) continue;
const testFileName = /^[^\.]*/.exec(testFile)![0];
describe(testFileName, () => {
for (const { name, run } of runTestFile(
fs.readFileSync(path.join(CASES_DIR, testFile), 'utf8'),
testFile,
)) {
it(name, () => run(n8nLanguage.parser));
}
});
}
});