1 Commits

Author SHA1 Message Date
znetsixe
92d7eba0fd P10.2: convert remaining dashboardAPI tests from Mocha to node:test
P6.7 converted test/basic/. Convert test/edge/ and test/integration/ the
same way: describe/it/expect → test/assert. No behavioural change.

5 / 5 tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 14:44:15 +02:00
2 changed files with 17 additions and 17 deletions

View File

@@ -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}`);
});

View File

@@ -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', () => {
test('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);
assert.ok(fs.existsSync(path.join(dir, file)), `missing ${file}`);
}
});
it('example flows are parseable arrays for dashboardAPI', () => {
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);
expect(Array.isArray(parsed)).toBe(true);
assert.ok(Array.isArray(parsed), `${file} is not an array`);
}
});
});