From 92d7eba0fd18829fd1f8e7bf8a89af7b380c85c8 Mon Sep 17 00:00:00 2001 From: znetsixe Date: Mon, 11 May 2026 14:44:15 +0200 Subject: [PATCH] P10.2: convert remaining dashboardAPI tests from Mocha to node:test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .../structure-examples-node-type.edge.test.js | 8 +++--- .../structure-examples.integration.test.js | 26 +++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/test/edge/structure-examples-node-type.edge.test.js b/test/edge/structure-examples-node-type.edge.test.js index 63913d6..9c3fa02 100644 --- a/test/edge/structure-examples-node-type.edge.test.js +++ b/test/edge/structure-examples-node-type.edge.test.js @@ -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}`); }); diff --git a/test/integration/structure-examples.integration.test.js b/test/integration/structure-examples.integration.test.js index e6594f3..65e539f 100644 --- a/test/integration/structure-examples.integration.test.js +++ b/test/integration/structure-examples.integration.test.js @@ -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`); + } });