2026-05-11 14:44:15 +02:00
|
|
|
const test = require('node:test');
|
|
|
|
|
const assert = require('node:assert/strict');
|
2026-02-19 17:37:36 +01:00
|
|
|
const fs = require('node:fs');
|
|
|
|
|
const path = require('node:path');
|
|
|
|
|
|
|
|
|
|
const dir = path.resolve(__dirname, '../../examples');
|
|
|
|
|
|
|
|
|
|
function loadJson(file) {
|
|
|
|
|
return JSON.parse(fs.readFileSync(path.join(dir, file), 'utf8'));
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-11 14:44:15 +02:00
|
|
|
test('examples package exists for dashboardAPI', () => {
|
|
|
|
|
for (const file of ['README.md', 'basic.flow.json', 'integration.flow.json', 'edge.flow.json']) {
|
|
|
|
|
assert.ok(fs.existsSync(path.join(dir, file)), `missing ${file}`);
|
|
|
|
|
}
|
|
|
|
|
});
|
2026-02-19 17:37:36 +01:00
|
|
|
|
2026-05-11 14:44:15 +02:00
|
|
|
test('example flows are parseable arrays for dashboardAPI', () => {
|
|
|
|
|
for (const file of ['basic.flow.json', 'integration.flow.json', 'edge.flow.json']) {
|
|
|
|
|
const parsed = loadJson(file);
|
|
|
|
|
assert.ok(Array.isArray(parsed), `${file} is not an array`);
|
|
|
|
|
}
|
2026-02-19 17:37:36 +01:00
|
|
|
});
|