Skip to content

iopa-io/iopa-test

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

IOPA
iopa-test

Build Status IOPA limerun

NPM

About

iopa-test is a collection of test harnesses for testing IOPA middleware

Status

Working release

Includes:

Stub Server (transport server)

  • Creates and receives dummy IOPA Messages per standard IOPA server spec
  • Not for production use, only for testing other modules

Installation

npm install iopa-test --save-dev

Usage

const stubServer = require('iopa-test').stubServer,
 iopa = require('iopa');

var app = new iopa.App();

app.use(function (context, next) {
      context.response["server.RawStream"].end("HELLO WORLD ");
      return next();
  });

var server = stubServer.createServer(app.build())

// SIMULATE INBOUND REQUEST 
server.receive("TEST");

// SIMULATE OUTBOUND REQUEST with MIRRORED RESPONSE 

server.connect("urn://localhost").then(function (client) {
      return client[SERVER.Fetch]("/topic", "GET", function (context) {
          context["server.RawStream"].end("HELLO WORLD ");
      });
  });
 

See iopa-logger for a reference implementation of this repository

About

`iopa-test` is a collection of test harnesses for testing IOPA reference middleware

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published