before functional changes by codex
This commit is contained in:
32
test/integration/structure-examples.integration.test.js
Normal file
32
test/integration/structure-examples.integration.test.js
Normal file
@@ -0,0 +1,32 @@
|
||||
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 requiredFiles = [
|
||||
'README.md',
|
||||
'basic.flow.json',
|
||||
'integration.flow.json',
|
||||
'edge.flow.json',
|
||||
'monster-dashboard.flow.json',
|
||||
'monster-api-dashboard.flow.json'
|
||||
];
|
||||
const flowFiles = requiredFiles.filter((file) => file.endsWith('.flow.json'));
|
||||
|
||||
function loadJson(file) {
|
||||
return JSON.parse(fs.readFileSync(path.join(dir, file), 'utf8'));
|
||||
}
|
||||
|
||||
test('examples package exists for monster', () => {
|
||||
for (const file of requiredFiles) {
|
||||
assert.equal(fs.existsSync(path.join(dir, file)), true, file + ' missing');
|
||||
}
|
||||
});
|
||||
|
||||
test('example flows are parseable arrays for monster', () => {
|
||||
for (const file of flowFiles) {
|
||||
const parsed = loadJson(file);
|
||||
assert.equal(Array.isArray(parsed), true);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user