Skip to content

Commit

Permalink
Update tests, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
martindale committed Jan 29, 2024
1 parent 119f51e commit 2e09bab
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 0 deletions.
7 changes: 7 additions & 0 deletions contracts/hub.fabric.pub.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict';

module.exports = {
domain: 'fabric.pub',
name: 'hub.fabric.pub',
version: '0.1.0'
};
17 changes: 17 additions & 0 deletions scripts/registry.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict';

const Registry = require('../contracts/registry');

async function main () {
const registry = new Registry();
await registry.start();
return {
registry: registry.id
};
}

main().catch((exception) => {
console.error('[SCRIPTS:REGISTRY]', 'Main Process Exception:', exception);
}).then((output) => {
console.log('[SCRIPTS:REGISTRY]', 'Main Process Output:', output);
});
31 changes: 31 additions & 0 deletions scripts/report.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
'use strict';

// Dependencies
const Filesystem = require('@fabric/core/types/filesystem');

// Services
// const Hub = require('../services/hub');

// Settings
const settings = require('../settings/local');

// Main Process
async function main (input = {}) {
const fs = new Filesystem(input);
await fs.start();

// const hub = new Hub(input);
// await hub.start();

return {
fs: fs,
// hub: hub.id
};
}

// Start & handle errors
main(settings).catch((exception) => {
console.error('[HUB:REPORT]', 'Main process threw Exception:', exception);
}).then((result) => {
console.log('[HUB:REPORT]', 'Main process finished:', result);
});
14 changes: 14 additions & 0 deletions tests/hub.contracts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict';

const assert = require('assert');
const Hub = require('../services/hub');

describe('hub.fabric.pub', function () {
describe('Hub', function () {
it('provides a valid contract', function () {
const hub = new Hub();
assert.ok(hub);
assert.ok(hub.contract);
});
});
});

0 comments on commit 2e09bab

Please sign in to comment.