22 lines
688 B
JavaScript
22 lines
688 B
JavaScript
const test = require('node:test');
|
|
const assert = require('node:assert/strict');
|
|
const fs = require('node:fs');
|
|
const path = require('node:path');
|
|
|
|
const dir = path.resolve(__dirname, '../../examples');
|
|
const exampleFlows = [
|
|
'basic.flow.json',
|
|
'integration.flow.json',
|
|
'edge.flow.json',
|
|
'monster-dashboard.flow.json',
|
|
'monster-api-dashboard.flow.json'
|
|
];
|
|
|
|
test('all example flows include node type monster', () => {
|
|
for (const file of exampleFlows) {
|
|
const flow = JSON.parse(fs.readFileSync(path.join(dir, file), 'utf8'));
|
|
const count = flow.filter((n) => n && n.type === 'monster').length;
|
|
assert.equal(count >= 1, true, file + ' missing monster node');
|
|
}
|
|
});
|