Compare commits
1 Commits
2874608375
...
92d7eba0fd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92d7eba0fd |
@@ -1,11 +1,11 @@
|
||||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const flow = JSON.parse(fs.readFileSync(path.resolve(__dirname, '../../examples/basic.flow.json'), 'utf8'));
|
||||
|
||||
describe('dashboardAPI edge example structure', () => {
|
||||
it('basic example includes node type dashboardapi', () => {
|
||||
test('basic example includes node type dashboardapi', () => {
|
||||
const count = flow.filter((n) => n && n.type === 'dashboardapi').length;
|
||||
expect(count).toBeGreaterThanOrEqual(1);
|
||||
});
|
||||
assert.ok(count >= 1, `expected ≥1 dashboardapi node, got ${count}`);
|
||||
});
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
@@ -7,17 +9,15 @@ 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);
|
||||
}
|
||||
});
|
||||
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}`);
|
||||
}
|
||||
});
|
||||
|
||||
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`);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user