24 lines
766 B
JavaScript
24 lines
766 B
JavaScript
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'));
|
|
}
|
|
|
|
describe('dashboardAPI integration examples', () => {
|
|
it('examples package exists for dashboardAPI', () => {
|
|
for (const file of ['README.md', 'basic.flow.json', 'integration.flow.json', 'edge.flow.json']) {
|
|
expect(fs.existsSync(path.join(dir, file))).toBe(true);
|
|
}
|
|
});
|
|
|
|
it('example flows are parseable arrays for dashboardAPI', () => {
|
|
for (const file of ['basic.flow.json', 'integration.flow.json', 'edge.flow.json']) {
|
|
const parsed = loadJson(file);
|
|
expect(Array.isArray(parsed)).toBe(true);
|
|
}
|
|
});
|
|
});
|