How to use the seneca.test function in seneca

To help you get started, we’ve selected a few seneca examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github senecajs / seneca-mesh / trial / base.js View on Github external
// To run:
// $ node base.js

var HOST = process.env.HOST || process.argv[2]
var BASES = (process.env.BASES || process.argv[3] || '').split(',')
var PORT = process.env.PORT
var BROADCAST = process.env.BROADCAST
var REGISTRY = JSON.parse(process.env.REGISTRY || '{"active":false}')

require('seneca')({ tag: 'b0', legacy: {transport: false} })
  .test()
  .use('consul-registry', REGISTRY || {})
  .use('..', {
    monitor: true,
    isbase: true,
    host: HOST,
    port: PORT,
    bases: BASES,
    discover: {
      multicast: {
        address: BROADCAST
      },
      registry: REGISTRY
    },
    dumpnet: false,
    sneeze: {
github senecajs / seneca-mesh / trial / foo.js View on Github external
// To run:
// $ node service-foo.js

var HOST = process.env.HOST || process.argv[2]
var BASES = (process.env.BASES || process.argv[3] || '').split(',')
var BROADCAST = process.env.BROADCAST
var REGISTRY = JSON.parse(process.env.REGISTRY || '{"active":false}')

require('seneca')({ tag: 'foo', legacy: {transport: false} })
  .test()
  .add('foo:1', function(msg, done) {
    done(null, { x: 1, v: 100 + msg.v })
  })
  .add('zed:1', function(msg, done) {
    done(null, { z: 1, f: 1, v: 100 + msg.v })
  })
  .add('zed:1,q:1', function(msg, done) {
    done(null, { z: 1, f: 1, q:1, v: 100 + msg.v })
  })
  .use('consul-registry', REGISTRY || {})
  .use('..', {
    pin: 'foo:1',
    host: HOST,
    bases: BASES,
    override:true,
github senecajs / seneca-mesh / trial / bar.js View on Github external
// To run:
// $ node service-foo.js

var HOST = process.env.HOST || process.argv[2]
var BASES = (process.env.BASES || process.argv[3] || '').split(',')
var BROADCAST = process.env.BROADCAST
var REGISTRY = JSON.parse(process.env.REGISTRY || '{"active":false}')

require('seneca')({ tag: 'bar', legacy: {transport: false} })
  .test()
  .add('bar:1', function(msg, done) {
    done(null, { y: 1, v: 100 + msg.v })
  })
  .add('zed:1', function(msg, done) {
    done(null, { z: 2, v: 100 + msg.v })
  })
  .use('consul-registry', REGISTRY || {})
  .use('..', {
    listen:[
      {pin: 'bar:1'},
      {pin: 'zed:1'},
    ],
    host: HOST,
    bases: BASES,
    discover: {

seneca

A Microservices Framework for Node.js

MIT
Latest version published 5 months ago

Package Health Score

70 / 100
Full package analysis